Scenario:
- Computer A and Computer B have each cloned a git repository from Github.
- On Computer A, I make changes to a repository, commit, and push to Github.
- On Computer B, I make changes to other, unrelated files, and commit.
- On Computer B, I try to push, but cannot because I forgot to pull my changes first.
- On Computer B, I pull changes, and git creates a "Merge branch 'master' of github.com:user/repo" commit.
- On Computer B, I push changes to Github, but have an annoying and unnecessary "Merge" commit in the commit history.
How can I use git merge
to place the merge commit before all my commits that have not been pushed? It's okay if this messes up the SHAs of the unpushed commits.
Do I need to git rebase
something?