|
1 | 1 | [alias] |
2 | 2 |
|
3 | | - # View abbreviated SHA, description, and history graph of the latest 20 commits |
| 3 | + # View abbreviated SHA, description, and history graph of the latest 20 commits. |
4 | 4 | l = log --pretty=oneline -n 20 --graph --abbrev-commit |
5 | 5 |
|
| 6 | +<<<<<<< HEAD |
6 | 7 | # View the current working tree status using the short format |
7 | 8 | #s = status -s |
8 | 9 | s = status --long |
9 | 10 |
|
10 | 11 | # Show the diff between the latest commit and the current state |
11 | 12 | #d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat" |
12 | 13 | d = !"clear; git diff" |
| 14 | +======= |
| 15 | + # View the current working tree status using the short format. |
| 16 | + s = status -s |
13 | 17 |
|
14 | | - # `git di $number` shows the diff between the state `$number` revisions ago and the current state |
| 18 | + # Show the diff between the latest commit and the current state. |
| 19 | + d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat" |
| 20 | +>>>>>>> upstream/main |
| 21 | + |
| 22 | + # `git di $number` shows the diff between the state `$number` revisions ago and the current state. |
15 | 23 | di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d" |
16 | 24 |
|
17 | | - # Pull in remote changes for the current repository and all its submodules |
18 | | - p = git pull --recurse-submodules |
| 25 | + # Pull in remote changes for the current repository and all its submodules. |
| 26 | + p = pull --recurse-submodules |
19 | 27 |
|
| 28 | +<<<<<<< HEAD |
20 | 29 | # Clone a repository including all submodules |
21 | 30 | #c = clone --recursive |
| 31 | +======= |
| 32 | + # Clone a repository including all submodules. |
| 33 | + c = clone --recursive |
| 34 | +>>>>>>> upstream/main |
22 | 35 |
|
23 | | - # Commit all changes |
| 36 | + # Commit all changes. |
24 | 37 | ca = !git add -A && git commit -av |
25 | 38 |
|
26 | | - # Switch to a branch, creating it if necessary |
| 39 | + # Switch to a branch, creating it if necessary. |
27 | 40 | go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f" |
28 | 41 |
|
29 | 42 | # Show verbose output about tags, branches or remotes |
30 | 43 | tags = tag -l |
31 | | - branches = branch -a |
32 | | - remotes = remote -v |
| 44 | + branches = branch --all |
| 45 | + remotes = remote --verbose |
33 | 46 |
|
34 | | - # List aliases |
| 47 | + # List aliases. |
35 | 48 | aliases = config --get-regexp alias |
36 | 49 |
|
37 | | - # Amend the currently staged files to the latest commit |
| 50 | + # Amend the currently staged files to the latest commit. |
38 | 51 | amend = commit --amend --reuse-message=HEAD |
39 | 52 |
|
40 | | - # Credit an author on the latest commit |
| 53 | + # Credit an author on the latest commit. |
41 | 54 | credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f" |
42 | 55 |
|
43 | | - # Interactive rebase with the given number of latest commits |
| 56 | + # Interactive rebase with the given number of latest commits. |
44 | 57 | reb = "!r() { git rebase -i HEAD~$1; }; r" |
45 | 58 |
|
46 | 59 | # Remove the old tag with this name and tag the latest commit with it. |
|
58 | 71 | # Find commits by commit message |
59 | 72 | fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f" |
60 | 73 |
|
61 | | - # Remove branches that have already been merged with master |
| 74 | + # Remove branches that have already been merged with main. |
62 | 75 | # a.k.a. ‘delete merged’ |
63 | 76 | dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" |
64 | 77 |
|
65 | | - # List contributors with number of commits |
| 78 | + # List contributors with number of commits. |
66 | 79 | contributors = shortlog --summary --numbered |
67 | 80 |
|
68 | | - # Merge GitHub pull request on top of the current branch or, |
69 | | - # if a branch name is specified, on top of the specified branch |
70 | | - mpr = "!f() { \ |
71 | | - declare currentBranch=\"$(git symbolic-ref --short HEAD)\"; \ |
72 | | - declare branch=\"${2:-$currentBranch}\"; \ |
73 | | - if [ $(printf \"%s\" \"$1\" | grep '^[0-9]\\+$' > /dev/null; printf $?) -eq 0 ]; then \ |
74 | | - git fetch origin refs/pull/$1/head:pr/$1 && \ |
75 | | - git checkout -B $branch && \ |
76 | | - git rebase $branch pr/$1 && \ |
77 | | - git checkout -B $branch && \ |
78 | | - git merge pr/$1 && \ |
79 | | - git branch -D pr/$1 && \ |
80 | | - git commit --amend -m \"$(git log -1 --pretty=%B)\n\nCloses #$1.\"; \ |
81 | | - fi \ |
82 | | - }; f" |
83 | | -
|
84 | 81 | # Show the user email for the current repository. |
85 | 82 | whoami = config user.email |
86 | 83 |
|
|
114 | 111 |
|
115 | 112 | [apply] |
116 | 113 |
|
117 | | - # Detect whitespace errors when applying a patch |
| 114 | + # Detect whitespace errors when applying a patch. |
118 | 115 | whitespace = fix |
119 | 116 |
|
| 117 | +[branch] |
| 118 | + |
| 119 | + # Show most recently changed branches first. |
| 120 | + sort = -committerdate |
| 121 | + |
120 | 122 | [core] |
121 | 123 |
|
122 | | - # Use custom `.gitignore` and `.gitattributes` |
| 124 | + # Use custom `.gitignore` and `.gitattributes`. |
123 | 125 | excludesfile = ~/.gitignore |
124 | 126 | attributesfile = ~/.gitattributes |
125 | 127 |
|
126 | | - # Treat spaces before tabs and all kinds of trailing whitespace as an error |
| 128 | + # Treat spaces before tabs and all kinds of trailing whitespace as an error. |
127 | 129 | # [default] trailing-space: looks for spaces at the end of a line |
128 | 130 | # [default] space-before-tab: looks for spaces before tabs at the beginning of a line |
129 | 131 | whitespace = space-before-tab,-indent-with-non-tab,trailing-space |
130 | 132 |
|
131 | | - # Make `git rebase` safer on macOS |
| 133 | + # Make `git rebase` safer on macOS. |
132 | 134 | # More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/> |
133 | 135 | trustctime = false |
134 | 136 |
|
|
176 | 178 |
|
177 | 179 | [diff] |
178 | 180 |
|
179 | | - # Detect copies as well as renames |
| 181 | + # Detect copies as well as renames. |
180 | 182 | renames = copies |
181 | 183 |
|
182 | 184 | [diff "bin"] |
183 | 185 |
|
184 | | - # Use `hexdump` to diff binary files |
| 186 | + # Use `hexdump` to diff binary files. |
185 | 187 | textconv = hexdump -v -C |
186 | 188 |
|
187 | 189 | [help] |
188 | 190 |
|
189 | | - # Automatically correct and execute mistyped commands |
| 191 | + # Automatically correct and execute mistyped commands. |
190 | 192 | autocorrect = 1 |
191 | 193 |
|
192 | 194 | [merge] |
|
223 | 225 |
|
224 | 226 | insteadOf = "gist:" |
225 | 227 |
|
| 228 | +[init] |
| 229 | + |
| 230 | + defaultBranch = main |
| 231 | + |
226 | 232 | # ANDY |
227 | 233 | [credential] |
228 | 234 |
|
|
0 commit comments