There is nothing wrong with clicking on the same branch from which you are reinstalling. These diagrams should illustrate why this works great:
Lets say what the fix graph looks like after you branched local_branch and made a couple of attempts (C and D). Someone else made one commit (E) in origin / master, since you forked local_branch:
A - B - E [origin / master]
\
\
\ - C - D [local_branch]
Then after running git rebase origin / master, the commit graph will look like this. "origin / master" is still the same, but "local_branch" has been reinstalled:
A - B - E [origin / master]
\
\
\ - C - D [local_branch]
At this point, if you do git push origin local_branch: master ", then this will result in a simple fast forward." Origin / master "and" local_branch "will be identical:
A - B - E - C - D [origin / master], [local_branch]
Now you can work more on "local_branch". In the end, you can get something like this:
A - B - E - C - D - G - I [origin / master]
\
\
\ - F - H [local_branch]
Please note that this is very similar to the initial chart. You can continue to repeat this process over and over.
You should avoid clicking on another branch from which you are not reinstalling. This is where you run into trouble (to another branch, it will look like your "local_branch" story was suddenly rewritten after you reinstalled it from "origin / master").
Dan Molding May 29 '09 at 1:38 a.m. 2009-05-29 01:38
source share