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