Scenario: I'm trying to get my unix dot-files under git. I have to work between (at least) the cygwin environment and some standard linux distros (ubuntu and opensuse), and I have files/lines of code that are only specific to, say, cygwin. Since I don't want to checkout useless files or have to deal with lots of cases inside my dotfiles, I'm creating branches for each of my environments. But most of the edits I do are common to all environments, so almost every time I made a commit I need to propagate that change to all my branches.
So basically I have several branches that are almost identical except for a few commits, and most commits I do need to be in all branches.
The question: what is the recommended git workflow for this, if there is any? Or is there a better setup (without using multiple branches?) for my scenario?
[I tried cherry-picking, but that involves quite a bit of work, and not to mention all the duplicate commits out here and the nightmare it is to keep my branches in sync.]
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…