Last active
March 12, 2020 10:05
-
-
Save andreav/3793325 to your computer and use it in GitHub Desktop.
my .gitconfig
This file contains 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] | |
email = andreav.pub@gmail.com | |
name = uallaualla | |
[color] | |
ui = true | |
interactive = auto | |
diff = auto | |
branch = auto | |
status = auto | |
[core] | |
pager = | |
[diff] | |
renames = true | |
tool = bc # gvimdiff | |
[difftool "gvimdiff"] | |
path = C:\\Program Files (x86)\\Vim\\vim82\\gvim.exe | |
[difftool "bc"] | |
path = C:\\Program Files\\Beyond Compare 4\\BCompare.exe | |
[merge] | |
tool = bc # gvimdiff3 | |
[mergetool "bc"] | |
path = C:\\Program Files\\Beyond Compare 4\\BCompare.exe | |
[mergetool "gvimdiff3"] | |
path = C:\\Program Files (x86)\\Vim\\vim82\\gvim.exe | |
[alias] | |
l = log --decorate --graph --oneline -20 --pretty=format:'%C(yellow)%h %Cred%ad %C(cyan)%an%Cgreen%d %Creset%s' --date=short | |
ll = log --decorate --graph --oneline --pretty=format:'%C(yellow)%h %Cred%ad %C(cyan)%an%Cgreen%d %Creset%s' --date=short | |
s = status | |
d = diff | |
dc = diff --cached | |
b = branch | |
la = log --decorate --graph --oneline --all -20 --pretty=format:'%C(yellow)%h %Cred%ad %C(cyan)%an%Cgreen%d %Creset%s' --date=short | |
laa = log --decorate --graph --oneline --all --pretty=format:'%C(yellow)%h %Cred%ad %C(cyan)%an%Cgreen%d %Creset%s' --date=short | |
ignored = ls-files --others -i --exclude-standard | |
pullall = !git pull && git submodule update --init --recursive --remote --merge | |
pushall = push --recurse-submodules=on-demand | |
commitall = commit -a | |
# git4f - https://github.com/andreav/git4f | |
#get/set integration branch | |
intbr = "!f() { [ $# -gt 1 ] && { echo Too many parameters >&2 && exit 2 ;}; \ | |
[ $# -eq 0 ] && { git config 4f.intbr && exit 0 || { echo Integration branch not set >&2 && exit 1 ;}; }; \ | |
git show-ref --quiet --verify \"refs/heads/$1\" || { echo Not a valid branch $1 >&2 && exit 1 ;}; \ | |
git config 4f.intbr $1 ; \ | |
}; f" | |
intbr-unset = config --unset 4f.intbr | |
intbr-istracked = "!f() { br_int=$(git intbr) || exit 1; \ | |
u=$(git rev-parse --symbolic-full-name --abbrev-ref $br_int@{upstream} 2>/dev/null) || \ | |
{ echo Integration branch \\'$br_int\\' not tracked >&2 && exit 1 ;} ; \ | |
echo \"$br_int <- $u\"; \ | |
}; f" | |
intbr-pull = "!f() { git chk-intbr || exit 1; \ | |
d=$(git intbr-istracked 2>&1) && \ | |
{ echo Pulling \\'$(git intbr)\\' && git pull || exit $?;} || \ | |
{ echo Intbr \\'$(git intbr)\\' not tracked, jump pull. ;} \ | |
}; f" | |
intbr-push = "!f() { git chk-intbr || exit 1; \ | |
d=$(git intbr-istracked) || { echo Cannot push. >&2 && exit 1 ;}; \ | |
remote=$(git config --get branch.$(git intbr).remote); \ | |
echo Pushing \\'$(git intbr)\\' to \\'$remote\\'; \ | |
git push $remote $(git intbr); \ | |
}; f" | |
# | |
#switch aliases | |
chk-intbr = "!git intbr 1>/dev/null && git checkout $(git intbr)" | |
chk-back = checkout @{-1} | |
currbr = "!f() { currbr=$(git symbolic-ref -q HEAD) || { echo detached-head >&2 && exit 1 ;}; \ | |
currbr=$(git rev-parse --symbolic-full-name --abbrev-ref $currbr); \ | |
echo $currbr; \ | |
}; f" | |
#feature branch mgt | |
ftrbr-start = "!f() { [ $# -ne 1 ] && echo \"Usage: git ftrbr-start <brname>\" >&2 && exit 2; \ | |
br_ftr_pre=$(git config --get 4f.ftrbr-prefix) 2>/dev/null; \ | |
git intbr-pull || exit 1; \ | |
echo Creating new ftr branch starting from \\'$(git intbr)\\'; \ | |
git checkout -b ${br_ftr_pre}$1 \ | |
;}; f" | |
ftrbr-integrate = "!f() { br_start=$(git currbr) || { echo Cannot integrate. >&2 && exit 1 ;}; \ | |
git intbr-pull || exit 1; \ | |
echo Merging \\'$br_start\\' into \\'$(git intbr)\\'; \ | |
git merge $(git config --get 4f.ftrbr-integrate-merge-opt) $br_start; \ | |
}; f" | |
ftrbr-integrate-rebase = "!f() { br_start=$(git currbr) || { echo Cannot integrate. >&2 && exit 1 ;}; \ | |
git ftrbr-update-rebase || exit 1; \ | |
git chk-intbr || exit 1; \ | |
echo Merging \\'$br_start\\' into \\'$(git intbr)\\'; \ | |
git merge $(git config --get 4f.ftrbr-integrate-rebase-opt) $br_start; \ | |
}; f" | |
ftrbr-update-merge = "!f() { br_start=$(git currbr) || { echo Cannot update. >&2 && exit 1 ;}; \ | |
git intbr-pull || exit 1; \ | |
git checkout $br_start || exit 1; \ | |
echo Merging \\'$(git intbr)\\' into \\'$br_start\\'; \ | |
git merge $(git config --get 4f.ftrbr-update-merge-opt) $(git intbr); \ | |
}; f" | |
ftrbr-update-rebase = "!f() { br_start=$(git currbr) || { echo Cannot update. >&2 && exit 1 ;}; \ | |
git intbr-pull || exit 1; \ | |
git checkout $br_start || exit 1; \ | |
echo Rebasing \\'$br_start\\' onto \\'$(git intbr)\\'; \ | |
git rebase $(git intbr); \ | |
}; f" | |
ftrbr-push = "!f() { d=$(git intbr-istracked) || { echo Cannot push. >&2 && exit 1 ;}; \ | |
git ftrbr-integrate || exit 1; \ | |
git intbr-push; \ | |
}; f" | |
ftrbr-push-rebase = "!f() { d=$(git intbr-istracked) || { echo Cannot push. >&2 && exit 1 ;}; \ | |
git ftrbr-integrate-rebase || exit 1; \ | |
git intbr-push; \ | |
}; f" | |
#configurations | |
[4f] | |
# intbr = master | |
ftrbr-prefix = ftr/ | |
# ftrbr-integrate-merge-opt = | |
# ftrbr-integrate-rebase-opt = | |
# ftrbr-update-merge-opt = --no-ff | |
[core] | |
pager = | |
[diff] | |
renames = true | |
tool = gvimdiff | |
[difftool "gvimdiff"] | |
cmd = gvimdiff \"$LOCAL\" \"$REMOTE\" | |
prompt = false | |
[merge] | |
tool = gvimdiff3 | |
trustExitCode = false | |
[mergetool "gvimdiff"] | |
cmd = gvimdiff “$BASE” “$LOCAL” “$REMOTE” “MERGED” | |
[mergetool "gvimdiff3"] | |
cmd = gvim -f -d -c \"wincmd J\" -c \"set diffopt+=iwhite\" \"$MERGED\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment