我将创建一个执行此操作的别名:
我已经将它添加到了git-bash .bash_profile中,但是我想看看是否有一种方法可以将其添加为别名,所以我不必使用git bash
Git完成将推送到当前分支#例如。 gf“提交消息”
gf() {
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
git add . && git commit -m "$1" && git push origin "$CURRENT_BRANCH"
} # Git merge # Eg. gm branch-name
gm() {
git merge "$1"
} # Git checkout # Eg. gc branch-name
gc(){
git checkout "$1" && gp
}