Thursday, 15 August 2013

How to switch back to previous branch after git pull?

How to switch back to previous branch after git pull?

I'm thinking of refreshing a git branch like this:
git checkout master && git pull && git co - && git rebase master
If any changes are pulled from origin then the previous branch gets
overwritten and 'git co -' no longer returns to the previous branch.
(Of course I could use the name of the branch, but I'm looking for
something generally applicable that can be transformed in an alias.)

No comments:

Post a Comment