a4ae74ab162a4c2e4b973a09bee910f5838c2e73
dot
Description
Dotfiles and new install guide.
Table of Contents
Starting Fresh
# Creates a folder ~/.dot which is a bare repository that will track our files.
git init --bare $HOME/.dot
# create an alias config which we will use to interact with our dotfile repo.
alias config='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME'
# Set a LOCAL REPO flag to hide files we are not explicitly tracking yet,(all).
dot config --local status.showUntrackedFiles no
# Make sure our alias is set.
echo "alias dot='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME'" >> $HOME/.bashrc
Migrating
git clone --bare https://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 {} .dot-backup/{}
fi;
dot checkout
dot config status.showUntrackedFiles no
Acknowledgments
Readme Driven Development - Tom Preston-Werner
Choose a License
Useful .gitignore Templates
Atlassian - How to store dotfiles
License
This project is licensed under the MIT License - see the MIT License file for details.
Description