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="[email protected]"
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="[email protected]"
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
?
in your scenario
- what is then preferred way of handling such issues in dotfiles? – Isletin your scenario
" I meant both the issues and the desired way of avoiding conflict resolution. Normally one would simply resolve the conflict when a change like that happens on the master branch. If you want to repeat the resolution every time a conflict like that happens you would usererere
to record the desired resolution. – Kincardine@EMAIL@
-like placeholders on machine branches and replacing these values with correct values withMakefile
or a simple script and not committing them. But this has a disadvantage of making my repository status dirty every time I run this script. Really, nobody has come across such problems when setting up their dotfiles repository? It's all about branches and easy synchronization. – Islet