Git force reset – a stackoverflow of a gazzilion good ideas

Git force reset – a stackoverflow of a gazzilion good ideas

I needn’t say more. Here is the link. In specific – this part of the conversation allowed me to keep changes that were NOT part of the other guy’s work AND force his stuff on top of mine. I was fiddling (to keep him working), he was working on the real stuff. HOWEVER, I had a problem pushing – so this link helped with that part. Put them together and here is the final set of commands in my context on my branch …

first do a commit of your changes

 git add *
 git commit -a -m "putting stuff aside so we can overwrite contents of this branch"

then fetch the changes and overwrite if there is a conflict

 git fetch origin hisBranchName
 git merge -s recursive -X theirs origin/hisBranchName

then push the stuff so you are ready to go

git push -f origin myCheckedOutBranchName

 

ELB Solutions.com Inc.
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.