1.7 KiB
1.7 KiB
dot
Description
There is no place like $HOME. Dotfiles bootstrapping guide.
Table of Contents
Start
Here is how you start using this setup.
Create a folder ~/.dot which is a bare repository that will track our dotfiles.
Create an alias for git called 'dot' to interact with our dotfile repo.
Set a flag to hide files we are not explicitly tracking yet. Which is everything.
Add the alias definition to your .bashrc.
git init --bare $HOME/.dot
alias dot='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME'
dot config --local status.showUntrackedFiles no
echo "alias dot='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME'" >> $HOME/.bashrc
Now add all of your dotfiles. Here is a example.
dot add .vimrc
Setup
Here is how you can migrate this setup to another system.
git clone --bare https://myrepos.dev/Randy-Jordan/dot.git $HOME/.dot
function dot {
/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME $@
}
mkdir -p .dot-backup
dot checkout
if [ $? = 0 ]; then
echo "Checked out dotfiles.";
else
echo "Backing up pre-existing dot files.";
dot checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .config-backup/{}
fi;
dot checkout
dot config status.showUntrackedFiles no
Acknowledgments
Tom Preston-Werner README Driven Development
Make a README
Choose a LICENSE
Atlassian - How to store Dotfiles