I'm trying to have a good Git workflow for contributing to an open source project (Endless Sky), but learning as I started out I've not ended up with a clean history. My workflow now is:
- My fork is here. I started using GitHub Desktop, but am beginning to switch to the command line.
- My fork's master is supposed to mirror the
upstream/master. Each feature I develop has a branch to itself, created from my master, and I use my own (local)
betabranches for combining my features to test/play.
My problem is on my forked master:
This branch is 15 commits ahead of endless-sky:master. No files changed; it's merge commit messages. This seemed ugly to me, so I did some reading, particularly the article Stop using 'git pull': A better workflow, and I've switched to rebasing/fast-forwarding.
But what's the best way to clean up an existing merge commit history in this situation? It touches a few of my feature branches too (see:
feature/JammingHaywire), and I don't want to be submitting a PR where the meaningful commits are drowned by meaningless merge commits.
I've read various other questions and am not quite clear whether I'm best:
master— is that safe, particularly with GitHub?
- trying to do a
git rebase -i [which commit?]back to some point — doesn't seem to work. Tried it back to
0facf00, some commit long before I forked, and my merge commit hashes (e.g.
3be4d97seen on GitHub) don't show up in the text file to drop. The end result is unchanged.
- doing something else I haven't thought of yet? Is what I'm trying to do 'good practice' in the first place?