I've been using git in the console for the last couple of months and I feel like there's a little too much typing.
Here's my flow (assuming I'm on foo branch):
[ ... working ... ]
git add .
git commit -m "Commit message"
git pull origin foo
git push origin foo
I know it's one of first world problems but is there a way of cutting the typing here? Can I just use git pull and git push for example? What's the difference between git push, git push origin foo?
For git push, you can configure to automatically push to remote branch with the same name as local using configuration.
git config push.default current
https://git-scm.com/docs/git-config#git-config-pushdefault
For git pull, you will need to make local branch tracking branch to remote branch.
Refer to https://stackoverflow.com/a/19279975/1433665
git commit -am 'subject: research the commands, Luke!'
git push
is equivalent unless you've added new files yourself, so you need to tell Git to hunt them down and track them with git add ., or git push sees new history on the remote branch you're tracking that you didn't know about already, so you need to pull first.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With