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 feature..dev

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.

怎么查看当前的git分支是基于哪个分支创建的? How to determine when a Git branch was created?

  • qq_43638135
    妲己再美究为妃: 博主没有想过自己接一些私活干吗?我现在还没毕业,但是我也确实听说外挂市场自动化游戏脚本市场挺火热的,并且报酬也很丰厚,但是具体的我也不是很清楚,求解答。 (1个月前 #47楼) 查看回复(2) 举报 回复
    22