-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig.fedora
76 lines (76 loc) · 3.49 KB
/
.gitconfig.fedora
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
[user]
name = Vincent Ho
email = [email protected]
[core]
#editor = /usr/bin/vim
editor = code --wait
excludesfile = ~/.gitignore_global
# delta config
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true
line-numbers = true
[merge]
conflictstyle = diff3
[diff]
colorMoved = default
# end delta config
[pull]
rebase = true
[alias]
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort
c = commit
co = checkout
s = status
b = branch
ss = status --short --branch
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lg-branch = !git lg --first-parent # List commits in this branch
lg-branch-no-merges = !git lg --first-parent --no-merges
lgg = log --graph --abbrev-commit --decorate --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)'
merge-noff = merge --no-ff # No fast forward
merge-squash = merge --squash # Merge and squash all commits into one
unstage = reset HEAD --
discard-unstaged = checkout -- .
dry-clean = clean -fd --dry-run
clean-force = clean -fd # Remove untracked files
push-safe-force = push --force-with-lease # Checks against remote changes
undo-initcommit = update-ref -d HEAD
undo-commit = reset --soft HEAD~1 # undo last commit
commend = commit --amend --no-edit # Add staged file to last commit
diff-staged = diff --staged # git diff --cached
stat = diff --stat HEAD^ HEAD
graph = git log --graph --all --decorate --stat --date=iso
word-diff = diff --word-diff
diff-branch = "!f() { branch1=${1-staging}; branch2=${2-production}; git log --left-right --graph --cherry-pick --oneline $branch1...$branch2; }; f"
# diff-branch = log --oneline staging ^production
recent = for-each-ref --count=10 --sort=-committerdate refs/heads/ --format="%(refname:short)"
overview = log --all --oneline --no-merges
recap = !git log --all --oneline --no-merges --author=${1-$(git config user.email)}
#changelog = "!changelog() { git log --oneline --no-merges $1..HEAD; }; changelog"
findchanges = !git log -S "$1" -- ${2-.} # git log -S "<code>" -- file_paths
changelog = !git log --oneline --no-merges ${1-$(git describe --abbrev=0)}..HEAD
stash-include-untracked = stash --include-untracked # Stash untracked and tracked files
stash-all = stash --all # Stash ignored, untracked, and tracked files
stash-show = stash show -p
log-last = log -1 HEAD
untrack = rm --cached # Remove file from repo and history
remotes = remote -v
push-all = "!pushall() { git push origin $1 && git push ci $1; }; pushall"
la = "!git config -l | grep alias | cut -c 7-" # list aliases
ls-branch = branch -r
tracked-branch = branch -vv
track = branch -u
grep-history = "!grephistory() { git rev-list --all | git grep $1; }; grephistory" # Grep commit changes
grep-message = log --oneline --grep= # Grep commit history
pick-file = ls-files | pick | xargs less
branches = "!sh -c \"git checkout $(git for-each-ref --sort='-authordate:iso8601' --format=' %(authordate:relative)%09%(refname:short)' refs/heads | pick | cut -f2)\""
set-upstream = branch --set-upstream # git branch --set-upstream master origin/master
git = !exec git
hide = update-index --assume-unchanged
unhide = update-index --no-assume-unchanged
show-hidden = ! git ls-files -v | grep '^h' | cut -c3-
[init]
defaultBranch = main