您的位置:首页 > 其它

git 相关变量和概念

2016-11-15 19:50 176 查看
https://jasoncodes.com/posts/gup-git-rebase

BRANCH=$(git symbolic-ref -q HEAD)

BRANCH=${BRANCH##refs/heads/}

BRANCH=${BRANCH:-HEAD}


输出:

+ BRANCH=refs/heads/master

+ BRANCH=master

+ BRANCH=master

if [ -z "$(git config branch.$BRANCH.remote)" -o -z "$(git config branch.$BRANCH.merge)" ]

输出 (从 .git/config 文件中读取出来的):

++ git config branch.master.remote

++ git config branch.master.merge

+ '[' -z origin -o -z refs/heads/master ']'

HEAD detached from origin/a-trade-dby-20161111-1129

说明HEAD已经被重指向, http://blog.csdn.net/trochiluses/article/details/8991701.
查看当前HEAD
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: