diff --git a/home/.gitconfig b/home/.gitconfig index c3fcacd..127473c 100644 --- a/home/.gitconfig +++ b/home/.gitconfig @@ -41,9 +41,9 @@ branch-name = "!git rev-parse --abbrev-ref HEAD" changelog-changed = "!test $(git diff --name-only HEAD origin/$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') | grep CHANGELOG.md | wc -l | xargs) = 1" main-branch = "!git remote show origin|grep HEAD|sed 's/.* //'" - + fork-or-origin = "!func(){ $(git remote show fork &>/dev/null); if [[ $? == 0 ]]; then echo \"fork\" ; else echo \"origin\"; fi; }; func" main = "!git remote set-head origin --auto && git checkout $(git main-branch) && git pull" - publish = "!func(){ if [[ $(git branch-name) != \"$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')\" ]]; then git push -u origin $(git branch-name) && (git changelog-changed || echo '\n\n⚠️ Dont forget to update changelog ⚠️ ') ; else echo "Wat?!"; fi; }; func" + publish = "!func(){ if [[ $(git branch-name) != \"$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')\" ]]; then git push -u $(git fork-or-origin) $(git branch-name) && (git changelog-changed || echo '\n\n⚠️ Dont forget to update changelog ⚠️ ') ; else echo "Wat?!"; fi; }; func" cleanup = "!git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done" dont-change-file = "!git update-index --assume-unchanged" ignore-file = "!git update-index --skip-worktree"