Skip to content

hzionn/myconfigs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 

Repository files navigation

my dotfiles

This repo is for tracking and storing my dotfiles across multiple devices.

Contents

.
├── .tmux.conf
├── .zshrc
└── .config/
    ├── alacritty/
    ├── fish/
    ├── helix/
    ├── karabiner/
    └── nvim/

How to

init on primary device

mkdir ~/.dotfiles
git init --bare $HOME/.dotfiles

alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no

usage

  • create a github repo for storing dotfiles
git remote add origin <github repo>
git branch -M main
git push -u origin main
  • add and commit files to repo
dotfiles status
dotfiles add .zshrc
dotfiles commit -m "add .zshrc"
dotfiles push
  • Git bare repo is not suppose to store anything, but if there is a need to
# add file or folder to repo
alias dotfilesa='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME add'

# remove file or folder from repo
alias dotfilesr='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME rm -r --cached'
  • clone to secondary device
git clone --bare <github repo> $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
dotfiles checkout

References