开发者

Gitting with a team

I'm developing an application and my friend wanted to join the development. So I created a git reposit开发者_开发知识库ory on assembla.com , performed a push and invited him to work with me.

My question is about the working proccess. We both use git bash on msysgit. I don't have problems with commit and push, the problem is with getting my friend changes. Why a simple pull does not work?


Short answer (judging from the comments):

git pull origin master

If that works as you're hoping, make it the default by adding this to your .git/config file:

[branch "master"]
    remote = origin
    merge = refs/heads/master

With that setup, you can then call:

git pull

...in future.

Long answer: It sounds like you haven't set up default merge targets.

You want a configuration setting that says, "Whenever I pull from remote repository X, automatically merge the changes with branch Y." (Typically, "When I pull from 'origin', merge with 'master'.") That's automatically set up when you do a 'git clone', but your working copy was created from scratch (not cloned) so you have to do it yourself.

You might find it interesting to compare your .git/config file with your friend's.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜