在使用github进行多人合作开发时,一定要注意彼此间版本的一致性,比如 A,B都在基于相同的版本上修改,但是A将自己的模块改完后,呼呼滴提交了,感觉甚爽,可是当B也码完代码后,呼呼滴传不上了,因为服务器上的版本和B的初始版本已经不一样了,所以这个时候B需要将服务器上的代码PULL下来,可是各种PULL不下来,因为没有创建branch,这个时候可以找到项目的.git文件中的config,在里面添加上这个代码
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "origin"]
url = https://github.com/NLPScott/MultiTest.git ( 个人项目的git地址 )
fetch = +refs/heads/*:refs/remotes/origin/*
remote = origin
merge = refs/heads/master
[remote "origin"]
url = https://github.com/NLPScott/MultiTest.git ( 个人项目的git地址 )
fetch = +refs/heads/*:refs/remotes/origin/*
再执行pull方法,发现工作ok了
然后在commit和push各种OK。。。。
关于上述原因可以参看http://blog.csdn.net/swimmer2000/article/details/8706862