-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchezmoi.cheat
63 lines (33 loc) · 1.78 KB
/
chezmoi.cheat
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
% chezmoi
# Add file to be managed by chezmoi
chezmoi add <file>
# Check what changes that chezmoi will make to your home directory
chezmoi diff
# Apply changes to your home directory
chezmoi apply -v
# Edit file
chezmoi edit <file>
# invoke a merge tool (by default vimdiff) to merge changes between the current contents of the file, the file in your working copy, and the computed contents of the file:
chezmoi merge <file>
# On any machine, you can pull and apply the latest changes from your repo
chezmoi update -v
# Install your dotfiles on new machine with a single command
chezmoi init --apply https://github.com/<username>/<reponame>.git
# Encrypt file
chezmoi add --encrypt <file>
# To force a refresh the downloaded archives
chezmoi --refresh-externals apply
# Add attribute to file
$addattr: echo -e "+after\n+before\n+empty\n+encrypted\n+exact\n+executable\n+modify\n+once\n+onchange"
chezmoi chattr <addattr> <file>
# Remove attribute to file
$delattr: echo -e "-after\n-before\n-empty\n-encrypted\n-exact\n-executable\n-modify\n-once\n-onchange"
chezmoi chattr -- <delattr> <file>
# Pull the changes from your repo and apply them in a single command
chezmoi update
# Pull the latest changes from your repo and see what would change, without actually applying the changes
chezmoi git pull -- --rebase && chezmoi
# Install chezmoi and your dotfiles on a new machine with a single command
sh -c "$(curl -fsLS https://chezmoi.io/get)" -- init --apply $GITHUB_USERNAME
# setting up transitory environments (e.g. short-lived Linux containers) you can install chezmoi, install your dotfiles, and then remove all traces of chezmoi, including the source directory and chezmoi's configuration directory
sh -c "$(curl -fsLS https://chezmoi.io/get)" -- init --one-shot $GITHUB_USERNAME