git 查看当前分支是基于哪个分支创建的

从master分支切出一个 fix分支,过了一段时间忘记了fix分支是基于哪一个分之切出来的了,我想找出来,该如何做?


git reflog --date=local --all | grep <branch name>
git show --summary `git merge-base <branch> master`
git show $(git merge-base <branch> master)
git show-branch <branch> master
gitk --all --select-commit=`git merge-base <branch> master`
git reflog --date=local
git reflog --date=relative

git log <branch> --not master
gitk <branch> --not master
git log

you will see what looks like the "history of your branch", but is really a list of commits reachable from 'branch' that are not reachable from master. This gives you the information you want, but if and only if you have never merged 'branch' back to master, and have never merged master into 'branch' since you created it. If you have merged, then this history of differences will collapse.