Suppose that my local repository is currently one commit behind the origin. Suppose that I commit in my local repository a change that is not conflicting with the origin. How can I push this change to the origin without first pulling/merging changes from the origin?
Suppose that my local repository is currently one commit behind the origin. Suppose that
Share
Ok, so you’re getting rejected for non-fast-forward push, and you have your reasons not to
want to pull the latest update from the remote. I think it’s obvious you need to branch off
your changes.
So lets create a a branch at the common point, HEAD~n, in your case HEAD~1:
Then fast-forward it:
Now the new branch has a common point, so just:
The remote repo now looks like this:
Now others can merge/rebase your feature. Ultimately you’ll have to either fix the bug and pull it locally, or you devise a slightly different workflow as you are keeping a custom local master.