SSDM uses git to track your dotfiles straight from your home directory (or wherever you want it to live) without interference. You can leave your dotfiles right where they are and just use SSDM to back them up.
SSDM is a helper tool for the similarly named dotfiles management technique. If you ever want to stop using SSDM with your dotfiles, then you can just stop using it! You can continue to use the technique manually or without installing SSDM (e.g. on other machines).
SSDM uses git by managing the naming of the .git directory and .gitignore file. When not directly being called, .git gets renamed to .ssdm and .gitignore gets renamed to .ssdmignore. This allows us to store the actual git repo wherever we want without worrying about conflicting subdirectories.
On top of that, the .gitignore (.ssdmignore) file uses a whitelist technique to make sure git only deals with files and directories specifically listed. e.g.
*
!.bashrc
!.vimrc
!.vimrc
SSDM is written in Node and can be installed with npm i -g ssdm
. This will install it globally and you can now run ssdm
like any other command. Run it without arguments or with the -h
option to get usage information.
SSDM uses a set of basic subcommands that act as basic macros to deal with the underlying git repository. At its core, SSDM will handle renaming .git and .gitignore to .ssdm and .ssdmignore, respectively.
Every command (other than init) run inside of a "context" where repository and directory and ignore file have the real "git version" of the names. Since this step is necessary in order to have git actually deal with the repo as a repo, this means that SSDM has to refuse dealing with anything other than .ssdm and .ssdmignore. This is so it does not accidentally mess with a non-SSDM git repository.
The currently supported commands are as follows:
This command initializes a new SSDM (git) repository. It also adds a basic ignore file (using the whitelist technique).
ssdm init
Add a file pattern to the whitelist. Subsequent commands will now deal with files matching this pattern.
ssdm track .bashrc
Make a new commit, automatically adding all new and/or changed files that match the whitelisted patterns.
ssdm save
Call a git command from within the SSDM context.
ssdm git push origin master
List the currently trackable files (i.e. whitelisted). These files are not necessarily tracked or even exist.
ssdm list