Difference between git checkout –track origin/branch and git checkout -b branch origin/branch

Does anybody know the difference between these two commands to switch and track a remote branch? git checkout -b branch origin/branch git checkout –track origin/branch I think both keep track of the remote branch so I can push my changes to the branch on origin, right? Are there any practical differences? 4 Answers 4

Why do I have to “git push –set-upstream origin “?

I created a local branch for testing Solaris and Sun Studio. I then pushed the branch upstream. After committing a change and attempting to push the changes: $ git commit blake2.cpp -m “Add workaround for missing _mm_set_epi64x” [solaris 7ad22ff] Add workaround for missing _mm_set_epi64x 1 file changed, 5 insertions(+) $ git push fatal: The current … Read more

Git merge errors

I have a git branch called 9-sign-in-out with perfectly working code, and I want to turn it into the master. I’m currently on the master branch. $ git branch 9-sign-in-out * master I’m trying to switch to 9-sign-in-out branch, but it doesn’t allow me to: $ git checkout 9-sign-in-out app/helpers/application_helper.rb: needs merge config/routes.rb: needs merge … Read more