简体   繁体   English

解决git版本控制中的冲突

[英]Resolving conflicts in git version control

I've got a big problem but I bet it's easy to solve. 我有一个大问题,但我敢打赌,这很容易解决。 I'm developing a website together with a friend using GiT for versioning control . 我正在与一个使用GiT进行版本控制的朋友一起开发一个网站。 We've just modified different parts of the same CSS file and then commited, then he pushed his commit. 我们只是修改了同一CSS文件的不同部分,然后提交了,然后他推送了提交。 We're both using master branches in local and remote repository for we don't know how to deal with it very well. 我们都在本地和远程存储库中使用master分支,因为我们不知道如何很好地处理它。 He pushed his commit to the remote repository, I don't. 他将提交推送到远程存储库,我没有。

What happens is. 会发生什么。 In the remote repository we have a file with A , I have a file with B and I want it to have A and B together in the remote and our local repository 在远程存储库中,我们有一个带A的文件,我有一个带B的文件,我希望它在远程存储库和本地存储库中同时包含AB

What should I do? 我该怎么办? I'm also accepting some suggestions about how we can keep on developing the website in a way we don't have too much problems to deal with it (maybe creating branches, some techniques or patterns we should follow, or anything else 'cause i'm new at versioning control) 我也接受一些建议,建议我们如何继续开发网站,而不会遇到太多问题(例如创建分支机构,应遵循的技术或模式,或者其他任何原因,因为是版本控制方面的新功能)

First, use git pull to download his changes into your local repository, then resolve any conflicts that git will inform you about. 首先,使用git pull将所做的更改下载到本地存储库,然后解决git将通知您的所有冲突。

when you're done with it, commit and push the changes. 完成后,提交并推送更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM