(. Ds_store) prevent multiple people from committing code to a conflict on GitHub

Source: Internet
Author: User

In a multi-partner project, the following issues occur after GIT pull Origin master finishes executing:

Auto-merging. Ds_store CONFLICT (content): Merge CONFLICT in. Ds_store Automatic merge failed;

The reason is. Files such as Ds_store need to be ignored when the project is submitted.

Ignore steps:

1, touch. Gitignore Create a file,

Open-e. Gitignore paste the configuration content to upload, and then save. (Content is https://www.gitignore.io/gitignore on the website of Mac os objective-c cocoapods Xcode can be obtained)

git Add.

Git commit

Then you want to use this globally. Gitignore

$ git config--global core.excludesfile ~/.gitignore

followed by the. gitignore file location. You can change it. But that configuration file must exist under that path.

2, manual or command line to delete the end. After Ds_store, execute the command:

Rm. Ds_store

git Add.

Git commit-a-M "Change content" or git commit-am is shorthand for the former

Git pull Origin Master

Git push Origin Master

After execution, other colleagues need to merge my code, and if a colleague has content submissions, execute the command:

git Add.

Git commit-a-M "Modified content"

Git pull Origin Master

Git merge Origin/master The following error occurred after executing this command:

Error:merge is isn't possible because you have unmerged files.

Hint:fix them up in the work tree, and then use ' Git add/rm '

Hint:as appropriate to mark resolution and make a commit.

Fatal:exiting because of an unresolved conflict.

After this error occurs, re-executes

git Add.

Git commit-a-M "SSSs"

Git pull Origin Master

git merge Origin/master

And then perform the following

Git push Origin Master

There will be no more on GitHub at this point. Ds_store the successful performance is: local have. Ds_store and Gitignore files on it, GitHub has. Gitignore No. Ds_store file.



Text/puppet (Jane book author)
Original link: http://www.jianshu.com/p/4f69c79b295f
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".

(. Ds_store) prevent multiple people from committing code to a conflict on GitHub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.