You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
templis cd6dd42178 „“ ändern 1 year ago
.config deleted nevim plugins, because they where handled by plug 2 years ago
.scripts „.scripts/“ ändern 2 years ago
.vimrc Add vimrc 2 years ago
.zsh-dircolors.config Add zsh-dircolors 2 years ago
.zshrc revision my zshrc 2 years ago „“ ändern 1 year ago
tmux.conf added a environment variable to start firefox with enabled hw- 2 years ago added a environment variable to start firefox with enabled hw- 2 years ago


this is not my work I've the idea from

In his words the technique below requires:

No extra tooling, no symlinks, files are tracked on a version control system, you can use different branches for different computers, you can replicate you configuration easily on new installation.

but for reason: ;)

  • git and
  • curl

How it work

The technique consists in storing a Git repository in a "side" folder (like $HOME/.cfg or $HOME/.myconfig) using a specially crafted alias so that commands are run against that repository and not the usual .git local folder, which would interfere with any other Git repositories around. Starting from scratch

If you haven't been tracking your configurations in a Git repository before, you can start using this technique easily with these lines:

git init --bare $HOME/.cfg
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
config config --local status.showUntrackedFiles no
echo "alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'" >> $HOME/.bashrc

The first line creates a folder ~/.cfg which is a Git bare repository that will track our files. Then we create an alias config which we will use instead of the regular git when we want to interact with our configuration repository. We set a flag - local to the repository - to hide files we are not explicitly tracking yet. This is so that when you type config status and other commands later, files you are not interested in tracking will not show up as untracked. Also you can add the alias definition by hand to your .bashrc or .zshrc or use the the fourth line provided for convenience.

I packaged the above lines into a snippet up. So that you can set things up with:

curl -Lks | /bin/bash

After you've executed the setup, any file within the $HOME folder can be versioned with normal commands, replacing git with your newly created config alias, like:

config remote add dotconfs
config checkout
config status
config add .vimrc
config commit -m "Add vimrc"
config add .bashrc
config commit -m "Add bashrc"
config push

Install your dotfiles onto a new system (or migrate to this setup)

config pull