How do I add a new dotfile with Dotbot?

Viewed 293

I'm trying to version my dotfiles on Linux via Dotbot, using init-dotfiles as initial setup. It worked great, but how do I add a new file to my .dotfiles repository?

In my case, I created a .bash_aliases file in my home folder.

It wouldn't make sense to run the init-dotfiles script and go through he whole setup process every time I create a new dotfile.

2 Answers

You could still run the script in verbose/preview mode, just to see the commands it runs

./init_dotfiles.sh verbose-config preview

Then you will be able to deduce the git command to run in order to add your new file (and future new files) to the dotfile repository.

That's correct, you shouldn't run the init-dotfiles script again.

To add a new dotfile, at a high level, you'll need to:

  • move the dotfile from the original location (e.g. ~/.bash_aliases) to the dotfiles repository (e.g. ~/.dotfiles/bash_aliases)
  • update your install.conf.yaml to specify how to symlink the file
  • add both the new dotfile (bash_aliases) and your install.conf.yaml to a new git commit
Related