-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitconfig
More file actions
55 lines (52 loc) · 2.54 KB
/
gitconfig
File metadata and controls
55 lines (52 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
[user]
name = chrisdane
email = cdanek@awi.de
[alias]
gethash = rev-parse --short HEAD
# log branch:
#lol = log --decorate --oneline --graph --abbrev-commit
lol = log --decorate --oneline --graph --abbrev-commit --date=format:'%Y-%m-%d %H:%M:%S' --format=format:'%C(blue)%h%C(reset) %s %C(cyan)(%ar% %an: %ad)%C(reset)%C(yellow)%d%C(reset)'
# log of current branch only: git log $branch..HEAD
lolb = "!f() { \
branch=$(git merge-base HEAD main); \
git log --decorate --oneline --graph --abbrev-commit --date=format:'%Y-%m-%d %H:%M:%S' --format=format:'%C(blue)%h%C(reset) %s %C(cyan)(%ar% %an: %ad)%C(reset)%C(yellow)%d%C(reset)' \"$branch\"..HEAD; \
}; f"
# log of --all: Pretend as if all the refs in refs/, along with HEAD, are listed on the command line as <commit>.
#lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
lola = log --all --decorate --oneline --graph --abbrev-commit --date=format:'%Y-%m-%d %H:%M:%S' --format=format:'%C(blue)%h%C(reset) %s %C(cyan)(%ar% %an: %ad)%C(reset)%C(yellow)%d%C(reset)'
# diff
ndiff = rev-list --count
diffn = diff --name-only
# diff wrt remote, e.g. after fetch but before merge:
diffr = "!f() { \
branch=$(git rev-parse --abbrev-ref HEAD); \
echo && \
echo \"(potentially run: 'git fetch [origin \"$branch\"]')\" && \
echo && \
echo \"== remote commits behind origin/$branch ==\" && \
echo \"run 'git log --oneline --graph --decorate --date=format:'%Y-%m-%d %H:%M:%S' --format=format:'%C(blue)%h%C(reset) %s %C(cyan)(%ar% %an: %ad)%C(reset)%C(yellow)%d%C(reset)' HEAD..origin/\"$branch\"'\" && \
echo && \
git log --oneline --graph --decorate --date=format:'%Y-%m-%d %H:%M:%S' --format=format:'%C(blue)%h%C(reset) %s %C(cyan)(%ar% %an: %ad)%C(reset)%C(yellow)%d%C(reset)' HEAD..origin/\"$branch\" && \
echo && \
echo \"== diff summary ==\" && \
echo \"run 'git diff --stat HEAD..origin/\"$branch\"'\" && \
echo && \
git diff --stat HEAD..origin/\"$branch\" && \
echo && \
echo \"run e.g. 'git diff HEAD..origin/\"$branch\" -- <file>'\" && \
echo ; \
}; f"
# blame for file creator; todo: does not work why
blamef = "!sh -c ' \
#echo $1 && \
git log --diff-filter=A --format=\"%ad %an <%ae> %s\" --date=short -- \"$1\" \
' -"
[color]
branch = auto
diff = auto
interactive = auto
status = auto
[credential]
helper = cache --timeout=10
[safe]
directory = *