|
1 | 1 | [alias] |
2 | | - |
3 | | - # View abbreviated SHA, description, and history graph of the latest 20 commits |
4 | | - l = log --pretty=oneline -n 20 --graph --abbrev-commit |
5 | | - |
6 | | - # View the current working tree status using the short format |
7 | | - s = status -s |
8 | | - |
9 | | - # Show the diff between the latest commit and the current state |
10 | | - d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat" |
11 | | - |
12 | | - # `git di $number` shows the diff between the state `$number` revisions ago and the current state |
13 | | - di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d" |
14 | | - |
15 | | - # Pull in remote changes for the current repository and all its submodules |
16 | | - p = !"git pull; git submodule foreach git pull origin master" |
17 | | - |
18 | | - # Clone a repository including all submodules |
19 | | - c = clone --recursive |
20 | | - |
21 | | - # Commit all changes |
22 | | - ca = !git add -A && git commit -av |
23 | | - |
24 | | - # Switch to a branch, creating it if necessary |
25 | | - go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f" |
26 | | - |
27 | | - # Show verbose output about tags, branches or remotes |
28 | | - tags = tag -l |
29 | | - branches = branch -a |
30 | | - remotes = remote -v |
31 | | - |
32 | | - # Amend the currently staged files to the latest commit |
33 | | - amend = commit --amend --reuse-message=HEAD |
34 | | - |
35 | | - # Credit an author on the latest commit |
36 | | - credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f" |
37 | | - |
38 | | - # Interactive rebase with the given number of latest commits |
39 | | - reb = "!r() { git rebase -i HEAD~$1; }; r" |
40 | | - |
41 | | - # Remove the old tag with this name and tag the latest commit with it. |
42 | | - retag = "!r() { git tag -d $1 && git push origin :refs/tags/$1 && git tag $1; }; r" |
43 | | - |
44 | | - # Find branches containing commit |
45 | | - fb = "!f() { git branch -a --contains $1; }; f" |
46 | | - |
47 | | - # Find tags containing commit |
48 | | - ft = "!f() { git describe --always --contains $1; }; f" |
49 | | - |
50 | | - # Find commits by source code |
51 | | - fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f" |
52 | | - |
53 | | - # Find commits by commit message |
54 | | - fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f" |
55 | | - |
56 | | - # Remove branches that have already been merged with master |
57 | | - # a.k.a. ‘delete merged’ |
58 | | - dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" |
59 | | - |
60 | | - # List contributors with number of commits |
61 | | - contributors = shortlog --summary --numbered |
62 | | - |
63 | | - # Merge GitHub pull request on top of the `master` branch |
64 | | - mpr = "!f() { \ |
65 | | - if [ $(printf \"%s\" \"$1\" | grep '^[0-9]\\+$' > /dev/null; printf $?) -eq 0 ]; then \ |
66 | | - git fetch origin refs/pull/$1/head:pr/$1 && \ |
67 | | - git rebase master pr/$1 && \ |
68 | | - git checkout master && \ |
69 | | - git merge pr/$1 && \ |
70 | | - git branch -D pr/$1 && \ |
71 | | - git commit --amend -m \"$(git log -1 --pretty=%B)\n\nCloses #$1.\"; \ |
72 | | - fi \ |
73 | | - }; f" |
| 2 | + s = status --short --branch |
| 3 | + l = log --oneline --graph --decorate -20 |
| 4 | + d = diff |
| 5 | + ds = diff --staged |
| 6 | + amend = commit --amend --no-edit |
| 7 | + branches = branch --all |
| 8 | + remotes = remote --verbose |
74 | 9 |
|
75 | 10 | [apply] |
76 | | -
|
77 | | - # Detect whitespace errors when applying a patch |
78 | 11 | whitespace = fix |
79 | 12 |
|
80 | 13 | [core] |
81 | | -
|
82 | | - # Use custom `.gitignore` and `.gitattributes` |
83 | | - excludesfile = ~/.gitignore |
84 | | - attributesfile = ~/.gitattributes |
85 | | -
|
86 | | - # Treat spaces before tabs and all kinds of trailing whitespace as an error |
87 | | - # [default] trailing-space: looks for spaces at the end of a line |
88 | | - # [default] space-before-tab: looks for spaces before tabs at the beginning of a line |
| 14 | + pager = delta |
89 | 15 | whitespace = space-before-tab,-indent-with-non-tab,trailing-space |
90 | 16 |
|
91 | | - # Make `git rebase` safer on OS X |
92 | | - # More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/> |
93 | | - trustctime = false |
94 | | -
|
95 | | - # Prevent showing files whose names contain non-ASCII symbols as unversioned. |
96 | | - # http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html |
97 | | - precomposeunicode = false |
98 | | -
|
99 | | -[color] |
100 | | -
|
101 | | - # Use colors in Git commands that are capable of colored output when |
102 | | - # outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.) |
103 | | - ui = auto |
104 | | -
|
105 | | -[color "branch"] |
106 | | -
|
107 | | - current = yellow reverse |
108 | | - local = yellow |
109 | | - remote = green |
110 | | -
|
111 | | -[color "diff"] |
112 | | -
|
113 | | - meta = yellow bold |
114 | | - frag = magenta bold # line info |
115 | | - old = red # deletions |
116 | | - new = green # additions |
117 | | -
|
118 | | -[color "status"] |
119 | | -
|
120 | | - added = yellow |
121 | | - changed = green |
122 | | - untracked = cyan |
| 17 | +[delta] |
| 18 | + line-numbers = true |
| 19 | + navigate = true |
123 | 20 |
|
124 | 21 | [diff] |
125 | | -
|
126 | | - # Detect copies as well as renames |
| 22 | + colorMoved = default |
127 | 23 | renames = copies |
128 | 24 |
|
| 25 | +[fetch] |
| 26 | + prune = true |
| 27 | + |
129 | 28 | [help] |
| 29 | + autocorrect = prompt |
| 30 | + |
| 31 | +[init] |
| 32 | + defaultBranch = main |
130 | 33 |
|
131 | | - # Automatically correct and execute mistyped commands |
132 | | - autocorrect = 1 |
| 34 | +[interactive] |
| 35 | + diffFilter = delta --color-only |
133 | 36 |
|
134 | 37 | [merge] |
| 38 | + conflictStyle = zdiff3 |
135 | 39 |
|
136 | | - # Include summaries of merged commits in newly created merge commit messages |
137 | | - log = true |
| 40 | +[pull] |
| 41 | + rebase = true |
138 | 42 |
|
139 | 43 | [push] |
140 | | -
|
141 | | - # Use the Git 1.x.x default to avoid errors on machines with old Git |
142 | | - # installations. To use `simple` instead, add this to your `~/.extra` file: |
143 | | - # `git config --global push.default simple`. See http://git.io/mMah-w. |
144 | | - default = matching |
145 | | - # Make `git push` push relevant annotated tags when pushing branches out. |
| 44 | + autoSetupRemote = true |
| 45 | + default = simple |
146 | 46 | followTags = true |
147 | 47 |
|
148 | | -# URL shorthands |
149 | | -
|
150 | | -[url "git@github.com:"] |
151 | | -
|
152 | | - insteadOf = "gh:" |
153 | | - pushInsteadOf = "github:" |
154 | | - pushInsteadOf = "git://github.com/" |
155 | | -
|
156 | | -[url "git://github.com/"] |
157 | | -
|
158 | | - insteadOf = "github:" |
159 | | -
|
160 | | -[url "git@gist.github.com:"] |
161 | | -
|
162 | | - insteadOf = "gst:" |
163 | | - pushInsteadOf = "gist:" |
164 | | - pushInsteadOf = "git://gist.github.com/" |
165 | | -
|
166 | | -[url "git://gist.github.com/"] |
| 48 | +[rebase] |
| 49 | + autoStash = true |
167 | 50 |
|
168 | | - insteadOf = "gist:" |
169 | | -[user] |
170 | | - name = Paul |
171 | | - email = phanminh65@gmail.com |
172 | | - signingkey = 02D7840A0C609597 |
173 | | -[commit] |
174 | | - gpgsign = true |
| 51 | +[include] |
| 52 | + path = ~/.gitconfig.local |
0 commit comments