Dotfiles/.config/git/config

64 lines
2.5 KiB
Plaintext
Raw Normal View History

2023-11-10 15:44:13 +00:00
[user]
name = Trevor Vallender
email = trevor@tsvallender.co.uk
[includeIf "gitdir:~/foxsoft/"]
path = ~/.config/git/config_foxsoft
[includeIf "gitdir:~/fs/"]
path = ~/.config/git/config_foxsoft
[core]
autocrlf = input
safecrlf = true
excludesfile = $XDG_CONFIG_HOME/git/gitignore
editor = nvim
[alias]
aa = add -A
2024-02-08 09:38:17 +00:00
# Selectively add files
2023-11-10 15:44:13 +00:00
ap = add --patch
2024-02-08 09:38:17 +00:00
# Selectively add files—including new ones
2023-11-10 15:44:13 +00:00
aap = !git add --intent-to-add . && git add --patch
br = branch
cb = clone --bare
2023-11-16 19:50:07 +00:00
cp = cherry-pick
2024-02-08 09:38:17 +00:00
# Show all commits on the current branch but not develop
curr = "!git log --no-merges \"$(git rev-parse --abbrev-ref HEAD)\" ^develop"
2023-11-10 15:44:13 +00:00
co = checkout
cm = commit
cma = commit --amend
2024-02-08 09:38:17 +00:00
# Fixup commit with all staged changes
fu = "!sh -c '(git diff-files --quiet || (echo Unstaged changes, please commit or stash with --keep-index; exit 1)) && COMMIT=$(git rev-parse $1) && git commit --fixup=$COMMIT && git rebase -i --autosquash $COMMIT~1' -"
2023-11-10 15:44:13 +00:00
g = log --all --grep # Search commit messages
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
last = log -1 HEAD
2024-02-08 09:38:17 +00:00
maindiff = "!git log --no-merges develop ^main"
noci = -o ci.skip
2023-11-10 15:44:13 +00:00
pf = push --force
2024-02-08 09:38:17 +00:00
# Create a merge request, assign it to me
2023-11-10 15:44:13 +00:00
pmrup = !git push -u origin $(git symbolic-ref --short HEAD) -o merge_request.create -o merge_request.assign="trevor" -o merge_request.remove_source_branch
2024-02-08 09:38:17 +00:00
# Create a merge request, assign it to me, mark it as draft
2023-11-10 15:44:13 +00:00
pmrdup = pmrup -o merge_request.draft
2024-02-08 09:38:17 +00:00
# Push against a new tracking branch with the same name
2023-11-10 15:44:13 +00:00
pushup = !git push -u origin $(git symbolic-ref --short HEAD)
2024-02-08 09:38:17 +00:00
rb = rebase
2023-11-10 15:44:13 +00:00
rbd = rebase develop
2024-02-08 09:38:17 +00:00
rbi = rebase -i
sq = "!f() { git reset --soft HEAD~$1 && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; }; f"
2023-11-10 15:44:13 +00:00
st = status
tree = log --oneline --graph --decorate --all
2024-02-08 09:38:17 +00:00
# “Undo” the last commit, leaving its contents staged
2023-11-10 15:44:13 +00:00
undo-commit = reset --soft HEAD~
wa = worktree add
wr = worktree remove
[init]
defaultBranch = main
[delta]
features = collared-trogon
navigate = true # use n and N to move between diff sections
side-by-side = true
line-numbers = true
[merge]
conflictstyle = diff3
[diff]
colorMoved = default