]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/kc60/keymaps/noroadsleft/readme_git.md
Updates to noroadsleft keymap for KC60 (#5127)
[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     # Cherry Pick
12     cp = cherry-pick
13
14     # Check out a Pull Request
15     cop = "!f() { git fetch upstream pull/$1/head:pr/$1; git checkout pr/$1; }; f"
16
17     # Sync master branch
18     sync = !git checkout master && git fetch upstream 2> /dev/null && git pull -n upstream master && git push origin master
19
20     # Return the abbreviated SHA-1 of the last three commits, oldest to newest
21     rl = rev-list -n 3 --abbrev-commit --reverse HEAD
22
23     # Add remote repo (for sending PRs to other forks, or checking out someone else's developments)
24     ar = "!f() { git remote add $1 https://github.com/$2/qmk_firmware.git; }; f"
25
26     # Return the last five commits on the branch, in a more compact format
27     hist  = log --pretty=format:\"%C(yellow)%h%Creset %Cgreen%ad%Creset %Cblue[%an%Cgreen% GK%Cblue]%C(yellow)%d%Creset%n  %w(100,0,2)%s%n\" --graph --date=iso-local -n 5
28     histt = log --pretty=format:\"* %C(yellow)%h%Creset %<(58,trunc)%s %Cblue%>(18,trunc)%an%Cgreen% G?%Creset @ %Cgreen%ad%Creset\" --date=iso-local -n 5
29     histb = log --reverse --pretty=format:\"- %Cblue%>(20,trunc)%an %Creset%<(97,trunc)%s\" --date=iso-local -n 5
30
31     # Follow a file's filename history
32     follow = log --follow --name-only --pretty=format:\"%C(yellow)commit %H%Creset%d\nAuthor: %an <%ae>\nDate:   %ad%n%n    %s%n\" --date=iso-local
33
34     # compact diff
35     df = "diff --compact-summary"
36
37     # List all the files changed in a commit
38     dt = "diff-tree --no-commit-id --name-only -r"
39
40     # Short-form status
41     st = "!git status --short --untracked-files=no"
42
43     # Returns the name of the current branch
44     branch-name = "!git rev-parse --abbrev-ref HEAD"
45     bn          = "!git branch-name"                 # short-form of the above
46
47     # Compare commit counts between current branch and QMK master
48     cc = "!f() { git fetch upstream; echo \"\e[0;32m$(git branch-name)\e[0m vs. \e[0;31mupstream/master\e[0m\"; git rev-list --left-right --count $(git branch-name)...upstream/master; }; f"
49
50     # Push to origin repo
51     po = "push origin $(git branch-name)"
52
53     # List the stashes
54     sl = "stash list"
55
56     # Unstage a file
57     unstage = "reset HEAD"
58
59     # Restore a file to the state it was in when checked out
60     restore = "checkout --"
61
62     # Compare local master repo to its upstream branch. If anything is returned, local branch has diverged from upstream.
63     cm = "!f() { git fetch upstream master; git diff $(git branch-name) upstream/master --compact-summary; }; f"
64     cml = "!f() { git fetch upstream master; git diff $(git branch-name) upstream/master; }; f"
65
66     # Delete a branch from local and remote
67     del-branch = "!f() { git branch -d $1; git push origin :$1; git fetch -p origin; }; f"
68
69     # Rebase with signatures
70     rbv = rebase --exec 'git commit --amend --no-edit -n -S' -i
71
72     # Force push without overwriting established history
73     pushf = push --force-with-lease
74
75
76 ```