Created by: Edward Ezekiel [email protected] Version: 1.0, 10.15.2024 Description: Dotfiles configuration
I used a git bare repository to backup my dotfiles. See DistroTube; Atlassian.
Create a dotfiles directory:
cd $HOME && mkdir dotfiles
Initialize the bare git repository in the dotfiles directory:
git init --bare $HOME/dotfiles
echo "alias dot='/usr/bin/git --git-dir=$HOME/dotfiles --work-tree=$HOME'" >> $HOME/.zshrc
- You can name the alias whatever you'd like, in this case I called it dot
- The command creates a permanent alias in your .zshrc
dot config --local status.showUntrackedFiles no
Reload your shell (or close the terminal and open a new one):
source $HOME/.zshrc
Create a new repository in GitHub called 'dotfiles'.
dot remote add origin [email protected]:edezekiel/dotfiles.git
dot branch -M main
dot push -u origin main
Add local dotfiles and push to the repository (repeat for each dotfile you would want to backup):
dot status
dot add .zshrc
dot commit -m "feat: Add my .zshrc"
dot push
mkdir $HOME/.github
cd $HOME/.github
touch README.md