]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/kc60/keymaps/noroadsleft/readme_git.md
[Keymap] Update to Drashna keymaps and Userspace (#5122)
[qmk_firmware.git] / keyboards / kc60 / keymaps / noroadsleft / readme_git.md
1 # @noroadsleft's Git aliases
2
3 [Return to the directory index.](./)
4
5 ```
6 [alias]
7     # change branches
8     co = checkout
9     cob = checkout -b
10
11     # sync master
12     sync = "!f() { if [ $(git branch-name) != "master" ]; then git checkout master; fi; git pull upstream master; git push origin master; }; f"
13
14     # Return the last five commits on the branch, in a more compact format
15     hist = log --pretty=format:\"%C(yellow)%h%Creset %Cgreen%ad%Creset%n   %w(100,0,3)%s%d [%an]%n\" --graph --date=iso-local -n 5
16     histm = log --pretty=format:\"%C(yellow)%h%Creset %w(100,0,3)%s%d [%an]\" --graph --date=iso-local -n 5
17     histt = log --pretty=format:\"%C(yellow)%h%Creset %<(88,trunc)%s [%an]\" --graph --date=iso-local -n 5
18     histb = log --reverse --pretty=format:\"- %<(98,trunc)%s [%an]\" --date=iso-local -n 5
19
20     # compact diff
21     df = "diff --compact-summary"
22
23     # Short-form status
24     st = "!git status --short"
25
26     # Returns the name of the current branch
27     branch-name = "!git rev-parse --abbrev-ref HEAD"
28
29     # short-form of the above
30     bn = "!git branch-name"
31
32     po = "push origin ($(git branch-name))"
33
34     # List the stashes
35     sl = "stash list"
36
37     # Show the contents of a numbered stash
38     # Syntax:
39     #   git st-show <int>
40     st-show = "!f() { git stash show stash@{$1} -p; }; f"
41
42     # Apply a stash, without deleting it from the list of stashes
43     # Syntax:
44     #   git st-copy <int>
45     st-copy = "!f() { git stash apply stash@{$1}; }; f"
46
47     # Unstage a file
48     unstage = "reset HEAD"
49
50     # Restore a file to the state it was in when checked out
51     restore = "checkout --"
52
53     # Compare local master repo to its upstream branch. If anything is returned, local branch has diverged from upstream.
54     cm = "!f() { git fetch upstream master; git diff $(git branch-name) upstream/master --compact-summary; }; f"
55     cml = "!f() { git fetch upstream master; git diff $(git branch-name) upstream/master; }; f"
56 ```