Skip to content

Instantly share code, notes, and snippets.

@barmic
Last active December 9, 2021 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barmic/cd570e19639afda1f43da384af899062 to your computer and use it in GitHub Desktop.
Save barmic/cd570e19639afda1f43da384af899062 to your computer and use it in GitHub Desktop.
Git configuration
[user]
name = Michel Barret
[alias]
st = status --short --branch
co = checkout
br = branch
brv = branch -vv
pushf = push --force-with-lease
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%aN>%Creset' --abbrev-commit
mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
merged-br = ! sh -c 'git log --color --pretty=format:"%D" --abbrev-commit | grep -v "^$"'
out = changes out
in = changes in
changelog = log --pretty=format:'%s' --abbrev-commit
sw = switch
review = !sh -c '~/bin/git-review' -
fixup = commit -a --amend --no-edit
[core]
autocrlf = input
[credential]
helper = store
[remote "origin"]
prune = true
[push]
default = current
[pull]
rebase = true
ff = yes
[merge]
ff = no
commit = no
[rebase]
autoStash = true
autosquash = true
[diff]
noprefix = true
[commit]
gpgsign = true
#[push]
# default = simple
#[branch "develop"]
# mergeoptions = --no-ff
# lga = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cd) %C(bold blue)<%aN>%Creset' --abbrev-commit
# clog = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %aN%C(reset)%C(bold yellow)%d%C(reset)'
# grog = 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)"
#!/usr/bin/zsh
branch=$(git branch -rl 'origin/feature/*' --format '%(refname:lstrip=2)' | grep -v <(git branch -l 'feature/*' --format '%(refname:lstrip=2)') | fzf)
git checkout -b "review/${branch#origin/feature/}" "${branch}"
git switch "review/${branch#origin/feature/}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment