Dotig

This is not a new project: I moved this introduction from my old website and translated it into English. So the publication date doesn’t match the project date. This is an old project. Currently, it is not archived but it is not really maintained neither.
I was looking for a way to manage my dotfiles efficiently with Git. I have tested some tools without being satisfy. So I decided to create my own dotfiles manager!
Introducing Dotig
Dotig allows you to manage your dotfiles with Git. Its mechanism is based on symlinks to deal with files and Git commands for the saving/versioning part.
I wanted a short name easy to remind and preferably not taken yet. So I went with a name gathering the two essential notions by contracting them: “dot” (for dotfiles) and “git” using mirrored writing.
What I wanted
Dotig needed to be able to realize multiple actions to be really helpful:
- add dotfiles to a Git repository,
- update the symlinks,
- delete the symlinks,
- create a commit,
- push the commits to a remote repository,
- fetch the changes from a remote repository,
- update the Git submodules,
- show local repository status,
- check for Dotig upgrades,
- show the Dotig version number,
- show help.
I also wanted to rely on the XDG specification for various reasons:
- I like to keep my
home
clean, when each file is in the right place. - This allows you not to hard-write a location and therefore to be able to easily transfer your dotfiles from one Linux distribution to another.
- I thought it would ease the OS compatibility (e.g. Mac/Linux): I’m no longer sure of that because of the casing (it seems to me that some configuration files starts with a capitalized letter in Mac).
So it places your files according to the following correspondences:
- $XDG_HOME_CACHE or
/home/utilisateur/.cache/
(default) becomes$DOTFILES/home/xdg_cache/
, - $XDG_HOME_CONFIG or
/home/utilisateur/.config/
(default) becomes$DOTFILES/home/xdg_config/
, - $XDG_HOME_BIN or
/home/utilisateur/.local/bin/
(default) becomes$DOTFILES/home/xdg_bin/
, - $XDG_HOME_DATA or
/home/utilisateur/.local/share/
(default) becomes$DOTFILES/home/xdg_data/
, - $XDG_HOME_LIB or
/home/utilisateur/.local/lib/
(default) becomes$DOTFILES/home/xdg_lib/
, - $XDG_HOME_STATE or
/home/utilisateur/.local/state/
(default) becomes$DOTFILES/home/xdg_sate/
, - all other files in $HOME (
/home/utilisateur/
) are moved by copying the structure in$DOTFILES/home/
.
Dotig then follows the reverse mapping when creating the symbolic links.
How it works?
Dotig can be used with a menu offering a list of choices or as a CLI command.
In the first case, you have to select an action to execute using numbers then to confirm your choice with y or n if needed.

In the second case, you can manage your dotfiles by writing the action in your terminal. For example, to update your symlinks, all you need to do is: dotig update
.
Options
Dotig supports options when invoked. For example, to display your repository status before the Dotig menu, you can use the following command: dotig -s
.
If you want to use Dotig using command line, you can also use some options for each command. You can display the available options for a command with the following format: dotig command -h
.

For example, when you use dotig update -b
, you can update your symlinks while looking for and deleting the broken ones.
Managing multiple repositories
Dotig allows you to configure a second repository if you want to save some files in a private repository. You’ll need to define a DOTFILES_PRIVATE
environment variable then to use the -p
option.
I’m using the word “private” for private repository but I don’t advise you to save your passwords in their. It is rather intended for backup files containing email addresses (such as the Git configuration file for example) and that you don’t want to leave in plain sight.
It is possible to use other repositories if needed but the feature is not built-in. So it’s less straightforward to achieve that. You’ll need to use dotig -i
and, when you are prompted to check if the repository is correct, you have to answer n and to enter your repository URL. With this approach, you can only use Dotig with its menu.
What Dotig doesn’t do
Some features might be missing. For example, you can’t have a list of all the tracked/non-tracked files.
Also, Dotig doesn’t manage secrets. This could be interesting rather than a private repository but I haven’t look at how this could be implemented. I don’t need that.
Get Dotig
If you want to test the tool, you can find the source code in its GitHub repository. The file to download is named dotig
. It weighs about 70kb. The size comes from the fact that it is a little over 2,600 lines of code all the same. I could have splitted it but I wanted a portable solution.
Once downloaded, put it in a directory included in your $PATH (e.g. ~/.local/bin
is included by default in Manjaro). You will also need to make sure that it has execution rights:
chmod +x dotig
Now you can use it from anywhere on your PC with the following command: dotig
.