Skip to content

wem1c/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 

Repository files navigation

wemic's dotfiles

Welcome reader! These are my dotfiles. Feel free to read/copy them as you wish!

Setup Repo

Setup a bare git repository in your home directory. Bare repositories have no working directory, so setup an alias to avoid typing the long command. Add the git directory ~/.dotfiles/ to the gitignore as a security measure. Setup remote and push. Hide untracked files when querying the status.

git init --bare "$HOME/.dotfiles"

echo 'alias dotfiles="/usr/bin/env git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME"' \
    >> "$HOME/.zshrc"
source "$HOME/.zshrc"

echo '.dotfiles' >> "$HOME/.gitignore"
dotfiles add "$HOME/.gitignore"
dotfiles commit -m 'Git: Add gitignore'

dotfiles remote add origin https://github.com/alfunx/.dotfiles
dotfiles push --set-upstream origin master
dotfiles config --local status.showUntrackedFiles no

Track Files

Use the default git subcommands to track, update and remove files. You can obviously also use branches and all other features of git.

dotfiles status
dotfiles add .zshrc
dotfiles commit -m 'Zsh: Add zshrc'
dotfiles add .vimrc
dotfiles commit -m 'Vim: Add vimrc'
dotfiles push

To remove a file from the repository while keeping it locally you can use:

dotfiles rm --cached ~/.some_file