aboutsummaryrefslogtreecommitdiff
path: root/posts/dotfiles.md
blob: 9bb84f8bf9f7e1114860b844ee5a0c08252e8d93 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# How I store my dotfiles.

I use a bare repository to sync my dotfiles and set it up as follows:

```
git init --bare $HOME/.cfg
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
config config --local status.showUntrackedFiles no

# The add and commit below are just an example of adding a file to the repo
config add .config/nvim/init.lua
config commit -m "Added init.lua"

git remote add origin REMOTE_URL
git push origin master
```

To install them from mine or someone else's git repo do the following:

```
echo ".cfg" >> .gitignore
git clone --bare REMOTE-GIT-REPO-URL $HOME/.cfg
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
config config --local status.showUntrackedFiles no
config checkout
```