Last active
December 9, 2021 16:11
-
-
Save barmic/cd570e19639afda1f43da384af899062 to your computer and use it in GitHub Desktop.
Git configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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