I stored my dotfiles in github, with lots pains, because of no automation. I have to update it myself.
Is there a way that can auto install/update/sync dotfiles? I mean in a fresh server, I download dotfiles and exec a install
script to copy dotfiles to local. After some time, I can exec a updateToRemote
script to push local changes to remote repo, and on another server, I can exec a updateToLocal
script to pull remote changes to local.
Something like that.
Whenever you want to add a new update to your dotfiles, all you need to do is simply open the dotfile in your home directory like normal. Edit it as you would any other day and then save the file.
The procedure is simple. I created the ${HOME}/dotfiles directory and then inside it I made subdirectories for all the programs whose configurations I wanted to manage. Inside each of those directories, I moved in all the appropriate files, maintaining the directory structure of my home directory.
The main source of information about dotfiles is dotfiles.github.io
.
It references blog posts like Using Git and Github to Manage Your Dotfiles, based on a symlink method.
For starters, we’ll be putting all of our dotfiles into a folder called dotfiles, like so:
/home/smalleycreative/dotfiles/vimrc
.
Then, we’ll simply symlink to them from our home directory.
Jaime mentions the Atlassian tutorial "The best way to store your dotfiles: A bare Git repository"
The technique consists in storing a Git bare 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.
(and then the dotfiles folder is managed as a git repo)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With