git: add some more tricks

some came from https://blog.gitbutler.com/git-tips-and-tricks/
This commit is contained in:
Mathieu Maret 2024-05-13 09:25:33 +02:00
parent d02a3296cc
commit 2ba32daa2a

View File

@ -1,3 +1,4 @@
# some tricks come from https://blog.gitbutler.com/git-tips-and-tricks/
[user] [user]
name = Mathieu Maret name = Mathieu Maret
email = mathieu.maret@gmail.com email = mathieu.maret@gmail.com
@ -11,6 +12,7 @@
[alias] [alias]
st = status st = status
ci = commit ci = commit
cm = commit -m
cia = commit --amend cia = commit --amend
cias = commit --amend --no-edit cias = commit --amend --no-edit
co = checkout co = checkout
@ -70,13 +72,19 @@
up = pull --rebase --autostash up = pull --rebase --autostash
rebaseour = "rebase -Xours" rebaseour = "rebase -Xours"
rank = "shortlog -s -n --no-merges" rank = "shortlog -s -n --no-merges"
root = rev-parse --show-toplevel root = rev-parse --show-toplevel
staash = stash --all
# -w ignore whitespace. -C 3 time, detect lines moved or copied in any commit
blamef = blame -w -C -C -C
# Show the log having the modificatoin for $1
search =!sh -c "git log -S $1 -p"
[rebase] [rebase]
# when rebasing, update the other common branch too. # when rebasing, update the other common branch too.
# See https://andrewlock.net/working-with-stacked-branches-in-git-is-easier-with-update-refs/ # See https://andrewlock.net/working-with-stacked-branches-in-git-is-easier-with-update-refs/
# Need git 2.38 # Need git 2.38
updateRefs = true updateRefs = true
[branch] [branch]
sort = -committerdate
#New branch track remote #New branch track remote
#autosetupmerge = always #autosetupmerge = always
# Rebase on git pull # Rebase on git pull
@ -157,3 +165,14 @@
ff = only ff = only
[commit] [commit]
verbose = true verbose = true
[column]
ui = auto
[gpg]
#Sign with ssh key (check signingkey)
format = ssh
[maintenance]
# start maintenance on a repo with git maintenance start
#repo = /home/mmaret/Sources/matos
[fetch]
#For large repo. Update the commit crash at each commit to have git log --graph super fast
#writeCommitGraph = true