I use git to manage my dotfiles, I use both linux and mac osx so I create separate branches for these two and another master for the common settings.
When I edit something which is common and I want to save the changes to another branch. This is how I work at the moment:
git checkout master
git commit ...
git checkout arch
git checkout master <file1>
git checkout master <file2>
This is a lot of work. Can I checkout a commit instead of file, or is there any even shorter way than this ?
Instead of cherry-picking (see its disadvantage here), I would rather merge master
in the other branches.
See for instance "Git branches for working on dev
while merging some changes into the master
".
That way, you know what was already integrated into your branches from master
.