Skip to content

waleslau/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Manage my dotfiles

You can also use yadm to manage dotfiles without writing aliases. These two methods are compatible (both based on Bare Git Repository).

start on a new system (migrate to this setup)

git clone --bare https://github.com/waleslau/dotfiles.git $HOME/.local/share/dotfiles.GitBareRepo

alias cfgit='/usr/bin/git --git-dir=$HOME/.local/share/dotfiles.GitBareRepo --work-tree=$HOME'

# move all the offending files to $HOME/.local/share/dotfiles.backup
mkdir -p $HOME/.local/share/dotfiles.backup && cfgit checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} $HOME/.local/share/dotfiles.backup/{}

cfgit checkout
# There may be error messages, need to create some subdirectories manually, then execute the above script again to move the old configuration file, and then checkout again

then enjoy it.

if want to set a new dotfile repo

1. Initialize a new repo

git init --bare $HOME/.local/share/dotfiles.GitBareRepo
alias cfgit='/usr/bin/git --git-dir=$HOME/.local/share/dotfiles.GitBareRepo --work-tree=$HOME'
echo "alias cfgit='/usr/bin/git --git-dir=$HOME/.local/share/dotfiles.GitBareRepo --work-tree=$HOME'" >> $HOME/.bashrc
echo "alias cfgit='/usr/bin/git --git-dir=$HOME/.local/share/dotfiles.GitBareRepo --work-tree=$HOME'" >> $HOME/.zshrc

2. Add the following to .gitignote

# ignore everything
*
# if want to tracking some file, must be added manually, like this:
# cfgit add -f filename

3. first commit

cfgit add -f .gitignore
cfgit commit -m "first commit"

Then it can be pushed to the remote repo

cfgit remote add xxx xxxxx.git
cfgit push -u xxx <branch>

enjoy it.

Inspired by:

About

My configs ...

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published