I want to store all my dotfiles in git
repository with separate branch
for each machine. I have a problem I can't solve that blocks me from
using git
for that purpose. I'd like to know how other people
solved it.
I'm going to have a single master
branch which contains only
template definitions and definitions which are supposed to be common
for all branches, for example:
export EMAIL="@EMAIL@"
export SURFRAW_google_results=1000
I will replace @EMAIL@
with my correct e-mail on machine branches
and commit it but SURFRAW_google_results
will stay the same. For
example, on work
branch I'll have this:
export EMAIL="user@corp.com"
export SURFRAW_google_results=1000
Now, I decided to change SURFRAW_google_results=1000
to 10. It's
supposed to be shared globally, so I first I change it on master
:
export EMAIL="@EMAIL@"
export SURFRAW_google_results=10
and then on I rebase work
onto master
:
$ git checkout work
$ git rebase master
And now I get conflict because the line that is above the line I
changed is different:
<<<<<<< a60114eea1c98d2354a07bd4fd0cdd63cba62e93
export EMAIL="@EMAIL@"
export SURFRAW_google_results=10
=======
export EMAIL="user@corp.com"
export SURFRAW_google_results=1000
>>>>>>> m
In case of bash
I could quickly get away with
including a machine-specific part by sourcing mechanism but how about
configs that do not support including/sourcing other configs such as .fluxbox/keys
or .screenrc
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…