Skip to content

Backup for my dotfiles configuration using git bare technique

Notifications You must be signed in to change notification settings

edezekiel/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dotfiles

Created by: Edward Ezekiel [email protected] Version: 1.0, 10.15.2024 Description: Dotfiles configuration

Backup technique

I used a git bare repository to backup my dotfiles. See DistroTube; Atlassian.

Git bare repository setup

1. Create a bare repository

Create a dotfiles directory:

cd $HOME && mkdir dotfiles

Initialize the bare git repository in the dotfiles directory:

git init --bare $HOME/dotfiles

2. Link the bare repository with a worktree

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

3. Hide untracked files

dot config --local status.showUntrackedFiles no

4. Reload your shell

Reload your shell (or close the terminal and open a new one):

source $HOME/.zshrc

5. Push dotfiles to GitHub

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

6. Create a README file (optional)

mkdir $HOME/.github
cd $HOME/.github
touch README.md

About

Backup for my dotfiles configuration using git bare technique

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published