I am trying some variations on an open source project and want to keep in sync with the master git.
On the other hand, I am sharing with an other developer a git repository with modified sources until we have a set of working diffs to submit to the master project.
We want to have a shared repository to track each other’s work, since we do not work in the same location.
I set up a git with two remotes and my tree is ahead of master of a few commits. This is no surprise.
git pull origin
works with no problem.
When I try to sync to the private shared repository, I try a
git push my_own_shared_git
I get this error
! [rejected] HEAD -> master (non-fast forward)
I am sure that git can handle this and much worse situations, but I would like to know how to handle it in the most natural and sensible way.
Ideally, I would like to handle a branch of the HEAD on origin and keep local history and diffs until I am able to submit my patches.
Thank you.
This error indicates that your mjy_own_shared_git has some commits which you have not.
So just type
before