manages setup and linking of dotfiles in a git repo
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

About allows you to easily link and manage your git-controlled dotfiles on any machine you happen to be working on, permanently or temporarily. Note: this script was written to work with older versions of Bash, specifically those without support for associative arrays (versions < 4).


By default will read its configuration settings from ~/etc/.link.conf. To change this, pass the -u flag followed by the location of the configuration file. Add the following to your shell's rc to make this permanent:

  1. if in $PATH:

    alias' -u ~/path/to/.link.conf'
  2. if not in $PATH:

    alias'~/path/to/ -u ~/.path/to/link.conf'

Specify the git repository containing the dotfiles by setting the SOURCE_DIR variable in the configuration file.

The configuration file contains an array of the files to be managed. It should be set up such that index 2k is the source file in the repository, and index 2k+1 is the destination of the link.


# ~/etc/.link.conf


    bashrc          $HOME/.bashrc
    gitconfig       $HOME/.gitconfig
    inputrc         $HOME/.inputrc
    profile         $HOME/.profile
    ssh/config      $HOME/.ssh/config
    vim             $HOME/.vim
    vimrc           $HOME/.vimrc
    zshrc           $HOME/.zshrc


Run the script without any arguments to see the current status of the files being managed:

If the script shows existing files, back them up with: -b

This will backup the existing dotfiles into BACKUP_DIR. Useful when working on a machine temporarily.

To write the symlinks for files that don't exist, use the -w flag, otherwise, overwrite them by adding the -f flag: -w -wf

To restore the environment to its original state, use: -r

Use the -h flag to see an overview of all available options: -h