|
1 | 1 | [alias] |
2 | 2 |
|
3 | | - # fucking upstream shit |
4 | | - set-upstream = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD` |
| 3 | + # fucking upstream shit |
| 4 | + set-upstream = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD` |
5 | 5 |
|
6 | 6 | # View abbreviated SHA, description, and history graph of the latest 20 commits |
| 7 | + # View abbreviated SHA, description, and history graph of the latest 20 commits. |
7 | 8 | l = log --pretty=oneline -n 20 --graph --abbrev-commit |
8 | 9 |
|
9 | | - # View the current working tree status using the short format |
| 10 | + # View the current working tree status using the short format. |
10 | 11 | s = status -s |
11 | 12 |
|
12 | | - # Show the diff between the latest commit and the current state |
| 13 | + # Show the diff between the latest commit and the current state. |
13 | 14 | d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat" |
14 | 15 |
|
15 | | - # `git di $number` shows the diff between the state `$number` revisions ago and the current state |
| 16 | + # `git di $number` shows the diff between the state `$number` revisions ago and the current state. |
16 | 17 | di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d" |
17 | 18 |
|
18 | | - # Pull in remote changes for the current repository and all its submodules |
19 | | - p = git pull --recurse-submodules |
| 19 | + # Pull in remote changes for the current repository and all its submodules. |
| 20 | + p = pull --recurse-submodules |
20 | 21 |
|
21 | | - # Clone a repository including all submodules |
| 22 | + # Clone a repository including all submodules. |
22 | 23 | c = clone --recursive |
23 | 24 |
|
24 | | - # Commit all changes |
| 25 | + # Commit all changes. |
25 | 26 | ca = !git add -A && git commit -av |
26 | 27 |
|
27 | | - # Switch to a branch, creating it if necessary |
| 28 | + # Switch to a branch, creating it if necessary. |
28 | 29 | go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f" |
29 | 30 |
|
30 | 31 | # Show verbose output about tags, branches or remotes |
31 | 32 | tags = tag -l |
32 | | - branches = branch -a |
33 | | - remotes = remote -v |
| 33 | + branches = branch --all |
| 34 | + remotes = remote --verbose |
34 | 35 |
|
35 | | - # List aliases |
| 36 | + # List aliases. |
36 | 37 | aliases = config --get-regexp alias |
37 | 38 |
|
38 | | - # Amend the currently staged files to the latest commit |
| 39 | + # Amend the currently staged files to the latest commit. |
39 | 40 | amend = commit --amend --reuse-message=HEAD |
40 | 41 |
|
41 | | - # Credit an author on the latest commit |
| 42 | + # Credit an author on the latest commit. |
42 | 43 | credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f" |
43 | 44 |
|
44 | | - # Interactive rebase with the given number of latest commits |
| 45 | + # Interactive rebase with the given number of latest commits. |
45 | 46 | reb = "!r() { git rebase -i HEAD~$1; }; r" |
46 | 47 |
|
47 | 48 | # Remove the old tag with this name and tag the latest commit with it. |
|
59 | 60 | # Find commits by commit message |
60 | 61 | fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f" |
61 | 62 |
|
62 | | - # Remove branches that have already been merged with master |
| 63 | + # Remove branches that have already been merged with main. |
63 | 64 | # a.k.a. ‘delete merged’ |
64 | 65 | dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" |
65 | 66 |
|
66 | | - # List contributors with number of commits |
| 67 | + # List contributors with number of commits. |
67 | 68 | contributors = shortlog --summary --numbered |
68 | 69 |
|
69 | | - # Merge GitHub pull request on top of the current branch or, |
70 | | - # if a branch name is specified, on top of the specified branch |
71 | | - mpr = "!f() { \ |
72 | | - declare currentBranch=\"$(git symbolic-ref --short HEAD)\"; \ |
73 | | - declare branch=\"${2:-$currentBranch}\"; \ |
74 | | - if [ $(printf \"%s\" \"$1\" | grep '^[0-9]\\+$' > /dev/null; printf $?) -eq 0 ]; then \ |
75 | | - git fetch origin refs/pull/$1/head:pr/$1 && \ |
76 | | - git checkout -B $branch && \ |
77 | | - git rebase $branch pr/$1 && \ |
78 | | - git checkout -B $branch && \ |
79 | | - git merge pr/$1 && \ |
80 | | - git branch -D pr/$1 && \ |
81 | | - git commit --amend -m \"$(git log -1 --pretty=%B)\n\nCloses #$1.\"; \ |
82 | | - fi \ |
83 | | - }; f" |
84 | | -
|
85 | 70 | # Show the user email for the current repository. |
86 | 71 | whoami = config user.email |
87 | 72 |
|
88 | 73 | [apply] |
89 | 74 |
|
90 | | - # Detect whitespace errors when applying a patch |
| 75 | + # Detect whitespace errors when applying a patch. |
91 | 76 | whitespace = fix |
92 | 77 |
|
| 78 | +[branch] |
| 79 | + |
| 80 | + # Show most recently changed branches first. |
| 81 | + sort = -committerdate |
| 82 | + |
93 | 83 | [core] |
94 | 84 |
|
95 | | - # Use custom `.gitignore` and `.gitattributes` |
| 85 | + # Use custom `.gitignore` and `.gitattributes`. |
96 | 86 | excludesfile = ~/.gitignore |
97 | 87 | attributesfile = ~/.gitattributes |
98 | 88 |
|
99 | | - # Treat spaces before tabs and all kinds of trailing whitespace as an error |
| 89 | + # Treat spaces before tabs and all kinds of trailing whitespace as an error. |
100 | 90 | # [default] trailing-space: looks for spaces at the end of a line |
101 | 91 | # [default] space-before-tab: looks for spaces before tabs at the beginning of a line |
102 | 92 | whitespace = space-before-tab,-indent-with-non-tab,trailing-space |
103 | 93 |
|
104 | | - # Make `git rebase` safer on macOS |
| 94 | + # Make `git rebase` safer on macOS. |
105 | 95 | # More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/> |
106 | 96 | trustctime = false |
107 | 97 |
|
|
145 | 135 |
|
146 | 136 | [diff] |
147 | 137 |
|
148 | | - # Detect copies as well as renames |
| 138 | + # Detect copies as well as renames. |
149 | 139 | renames = copies |
150 | 140 |
|
151 | 141 | [diff "bin"] |
152 | 142 |
|
153 | | - # Use `hexdump` to diff binary files |
| 143 | + # Use `hexdump` to diff binary files. |
154 | 144 | textconv = hexdump -v -C |
155 | 145 |
|
156 | 146 | [help] |
157 | 147 |
|
158 | | - # Automatically correct and execute mistyped commands |
| 148 | + # Automatically correct and execute mistyped commands. |
159 | 149 | autocorrect = 1 |
160 | 150 |
|
161 | 151 | [merge] |
|
0 commit comments