File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,36 @@ yarn () {
30
30
}
31
31
```
32
32
33
+ ## Git tricks
34
+
35
+ ### Aliases
36
+
37
+ Aliases to easily update your main branch, e.g after PR was merged.
38
+ It updates the branch in the background before switching to it, so that editor/tooling experience the least changes.
39
+
40
+ - ` upc ` : update specified branch (defaults to ` main ` ), and switch to it
41
+ - ` upd ` : update specified branch (defaults to ` main ` )
42
+
43
+ ```
44
+ [alias]
45
+ upc = "!git updonly \"${1:-main}\" && git checkout \"${1:-main}\" || git pull #"
46
+ upd = "!git updonly \"${1:-main}\" || git pull #"
47
+ updonly = "!git fetch `git gitremote \"$1\"` \"$1\":\"$1\" #"
48
+ gittrack = "!git for-each-ref --format='%(upstream:short)' $(git rev-parse --symbolic-full-name \"$1\") #"
49
+ gitremote = "!git gittrack \"$1\" | sed 's@/.*@@' #"
50
+ ```
51
+
52
+ ### Other recommendations
53
+
54
+ ```
55
+ [pull]
56
+ rebase = true
57
+ [rebase]
58
+ autoStash = true
59
+ [init]
60
+ defaultBranch = main
61
+ ```
62
+
33
63
## Znap - Oh My Posh and pnpm auto completion support
34
64
35
65
Install oh-my-posh, install pnpm autocomple zsh, and use:
You can’t perform that action at this time.
0 commit comments