-
Notifications
You must be signed in to change notification settings - Fork 0
/
.README
51 lines (37 loc) · 1.12 KB
/
.README
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
For tracking and installing dotfiles. Using a bare git repo in a separate
git-dir, as well as ignoring all untracked files so that no symlinks or similar
are necessary.
## Initial repo setup:
```
git init --bare $HOME/.dots-git
alias dgit='git --git-dir=$HOME/.dots-git/ --work-tree=$HOME'
dgit config status.showUntrackedFiles no
```
## Usage
Now any files in $HOME can be versioned as usual with things like:
```
dgit status
dgit add .vimrc
dgit commit -m 'add vimrc'
dgit push
```
To see what files are being tracked:
`dgit ls-tree --full-tree -r HEAD`
or simply `dgit ls-files`
## Install the dotfiles onto a new system
```
git clone --bare [email protected]:grahamlopez/dots $HOME/.dots-git
dgit checkout
```
if there are already dotfiles present, then need to back them up and move out of
the way and rerun `dgit checkout`
## git configuration
Sometimes, I have had to manually configure the repo after checkout;
edit `.dots-git/config` and add the following:
```
[remote "origin"]
url = [email protected]:grahamlopez/dots.git
fetch = +refs/heads/*:refs/remotes/origin/*
[status]
showUntrackedFiles = no
```