master
* locationAlbum
后来团队其他人发现了版本控制混乱问题,决定用git-flow这个工具解决问题。他们首先用git-flow在master上面建立了一个develop分支,大家在develop上面开发。当我准备合并时,发现git branch看不到他们建立的分支:
>git branch
master
*locationAlbum
但是使用git ls-remote命令可以查看的到
179b789fb3e5562a1d5e1a221252b3cfeb8afb29 HEAD
dadf5a5d829a7a11d6f9a594f8262eb1b5931acc refs/heads/develop
deef2cd04eb8c7c8d72d107917e551e53665424e refs/heads/locationAlbum
179b789fb3e5562a1d5e1a221252b3cfeb8afb29 refs/heads/master
我强制使用fetch命令,下载develop,发现不奏效。
fatal: ‘develop’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我将上面内容paste到google中,搜索到需要保证我可见的分支名在.git/refs/heads 中,大概知道怎么回事了,尝试的修改了.git/refs/heads 的引用添加了develop,再用git branch查看,果然出现了!
develop
* locationAlbum
master
git checkout locationAlbum也没有问题。此后merge两个版本,重新提交,合并代码解决了问题。