I am collaboratively working on a project with someone, so we decided to use git. Unfortunately, we frequently code in locations with no internet, so we end up with something like this:
origin/master: A---B---C
\
mylocalmaster: D---E---F
\
hismaster: G---H---I
Now, say he pushes his commits and gets this:
origin/master: A---B---C---G---H---I
\
master (local): D---E---F
All I want to do is push my commits to get this in both my local repo and the online one:
A---B---C---D---E---F---G---H---I
It seems to work when I do git push
, but the trouble arises when I do git fetch
and then git merge
. All I'm trying to do is get his commits into my local repo, but I end up with a merge commit saying something like Merge remote-tracking branch 'origin/master'
as its message.
I don't want to have this pointless commit, since there is no conflicting code in our commits. We are working on completely different files, so there's no reason to have this commit. How can I prevent git from creating this merge commit?