summaryrefslogtreecommitdiff
path: root/README.md
blob: a7ed3b08dfb3db57eeca2740613e2d9032baed46 (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

## Installation

To install GNU Stow, use your preferred package manager

### OpenSUSE Tumbleweed

```zsh
$ sudo zypper up
$ sudo zypper in stow
```

### Load (symlink) dotfiles

- <dotfiles> - refers to the name of the directory where the dotfiles git repo lives
Make sure that <dotfiles> is a subdirectory of `$HOME`

```zsh
$ cd ~/<dotfiles> && stow .
```

You may need to add the `--adopt` flag to stow to override existing configurations in `$HOME`
```zsh
$ cd ~/<dotfiles> && stow --adopt .
```

## Usage

- <dotfiles> - refers to the name of the directory where the dotfiles git repo lives
- <path> - The directory path where the file/s live
- <file> - The file's name, this is the file you want to add/update/delete

### Add

Add a new file to the dotfiles repo

```zsh
$ mv ~/<path>/<file> ~/<dotfiles>/<path>/<file>
$ cd ~/<dotfiles> && stow .
```

### Update

As GNU Stow uses symlinks, you can simply edit it (in either ~/<path>/<file> or ~/<dotfiles>/<path>/<file>) and the changes will be present in both locations

### Delete

Remove a file from GNU Stow and the filesystem

```zsh
$ rm ~/<dotfiles>/<path>/<file>
$ rm ~/<path>/<file>
```

Remove a file only from GNU Stow, but keep it in the filesystem

```zsh
$ rm ~/<path>/<file>
$ mv ~/<dotfiles>/<path>/<file> ~/<path>/<file>
$ cd ~/<dotfiles> && stow .
```

### Commit changes to the GitHub repository (optional)

```zsh
$ cd ~/<dotfiles>
$ git add .
$ git commit -m "Your message here"
$ git push origin master
```

### Pull Changes from the GitHub repository

```zsh
$ cd ~/<dotfiles>
$ git pull origin master
$ stow -- adopt .
```