Code merge conflicts are most common during development, especially when multiple people are working together. So it’s not uncommon for developers to encounter conflicts when merging code.
This blog to share in a conflict won’t solve, after the first backup the latest code, local and then according to the latest Git links to pull the line of code, and then compares modification, this method although trouble, but in order to emergency or consider, generally do not recommend this operation. Conflict resolution in this case is usually done by developers who are not proficient with Git, or by developers who encounter an irresistible conflict and have to sacrifice one side to save the other.
There are only two ways to pull the code from Git to the Mac PC. The first way is to directly copy the project source link of the Git platform, and then open the terminal of the Mac PC to pull the project to the Mac PC through the command line. The second method is to pull the project from the Sourcetree management software through the Git platform’s project source link.
Method 1: Pull the project to the local through the terminal of the Mac computer
1. Directly open the project link in the browser, find the source address of Git link, and copy the source link. In this case, Clone with HTTP is used;
2, then open the Mac terminal, and enter the command line: git clone + “project source address link” and press Enter. After a short wait, the project is successfully pulled to the Mac’s local root directory, and directly go to the root directory to view the project.
Method two: pull the project to the local method through sourcetree
1. Directly open the Git link address of the project in the browser and copy the source address of the project;
2, open the Sourcetree client on the Mac computer, and then go to the Sourcetree main screen, click “New…” To enter;
3. Select Clone from URL.
4, Paste the source address link copied from the above Git project into the dialog box, and click “clone”, you can pull the project to the local, enter the computer root directory to open the project;
Through the above two methods, you can directly pull the project code from Git to the local computer, and directly enter the command line through the Mac terminal: open. Press Enter to open the home directory of the computer where the project is located, and then perform relevant operations.
The above is all the content of this chapter. Welcome to pay attention to the wechat public account of Sanzhan “iOS development by Sanzhan”, and the Sina Weibo account of Sanzhan “Sanzhan 666”, welcome to pay attention to it!