I'm wo开发者_开发百科rking under project (using github) with my friend. The situation:
- My friend checkouted the sources
- I made some changes and committed them
- My friend worked with his copy and now he tries to commit them. The problem is that he can't do this.
The only way I see now is reseting his local copy, pull the newest changes and write back all the new code he wrote. How would it be?
you can always fetch from upstream and then merge your changes. git provides a convenience call for this: git pull
, it will fetch and then merge. your friend should then be able to push again
You can always commit, although you may not be able to push. It looks like in your case everyone needs to commit their changes and then someone needs to pull and resolve conflicts, if any.
Your friend needs to pull the latest version of the source, apply his changes to it, and then he can push it into the git.
your friend does not need to reset anything. git will try to automatically merge your changes into his changes when he does: git pull
if your changes conflict with his changes, git will tell him when he does his pull. after resolving any conflicts, your friend will be able to push his changes back to github.
精彩评论