-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.gitconfig
More file actions
62 lines (46 loc) · 1.64 KB
/
.gitconfig
File metadata and controls
62 lines (46 loc) · 1.64 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
56
57
58
59
60
61
62
# This is Git's per-user configuration file.
[include]
path = ~/.gitconfig.d/self
# Inside ~/.gitconfig.d/self, create the following
# [user]
# name = Your Name
# email = your.name@pls.com
[merge]
tool = vimdiff
[mergetool]
keepBackup = false
[pretty]
csv = \"%d\", \"%C(yellow)%h%Creset\", \"%C(red)%C(bold)%an%Creset\", \"%C(cyan)%C(bold)%ci%Creset\", \"%C(yellow)%cn%Creset\", \"%s\"
[alias]
list-aliases = "!git config -l | grep alias | cut -c 7-"
force-pull = "!git fetch origin && git reset --hard origin/$(git rev-parse --abbrev-ref HEAD)"
uncommit = reset --soft HEAD^
unstage = reset HEAD --
cma = commit --amend
cmm = commit --message
co = checkout
cof = !git checkout $(git branch | fzf)
rs1 = reset HEAD^
rs2 = reset HEAD^^
# dynamic reset
# git rs5 to run git reset HEAD~5
rs = "!f() { CMD=${0##*-}; NUM=${CMD##*rs}; if [ -z \"$NUM\" ]; then NUM=1; fi; git reset HEAD~$NUM; }; f"
rs-hard = reset HEAD --hard
rb1 = rebase -i HEAD~1
rb2 = rebase -i HEAD~2
# dynamic rebase
# git rb 5 to run rebase -i HEAD~5
rb = "!f() { git rebase -i HEAD~${1:-1}; }; f"
w = worktree
wa = worktree add
wr = worktree remove
wl = worktree list
prettylog = "log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
# git log --pretty=oneline | grep 'TICKET-12345'
prettygrep = "!f() { git log --pretty=oneline | grep \"$1\"; }; f"
prettycsv = log --pretty=csv
rootpath = rev-parse --show-toplevel
# git follow /path/to/file.rb. Tracks file renaming
follow = log --follow --
[url "git@github.com:"]
insteadOf = https://github.com/