Skip to content

Instantly share code, notes, and snippets.

@j1g54w1337
Last active February 2, 2022 10:27
Show Gist options
  • Select an option

  • Save j1g54w1337/e68e5d241664cee10a441ae7dc3d1656 to your computer and use it in GitHub Desktop.

Select an option

Save j1g54w1337/e68e5d241664cee10a441ae7dc3d1656 to your computer and use it in GitHub Desktop.
setting up a dotfiles repo

Setting up a dotfiles repo

Initial setup

git init --bare $HOME/.myconfigs
echo 'alias config="/usr/bin/git --git-dir=$HOME/.myconfigs/ --work-tree=$HOME"' >> $HOME/.zshrc
source ~/.zshrc
config config --local status.showUntrackedFiles no

Adding first file to the repo

config status
config add .vimrc
config commit -m "Add vimrc"
config remote add origin https://www.github.com/username/repo.git
config push origin master

Setup other systems to use the repo

echo 'alias config="/usr/bin/git --git-dir=$HOME/.myconfigs/ --work-tree=$HOME"' >> $HOME/.zshrc
source ~/.zshrc
echo ".myconfigs" >> .gitignore
git clone --bare https://www.github.com/username/repo.git $HOME/.myconfigs
config checkout
config config --local status.showUntrackedFiles no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment