Introduction to the use of git in Xcode and solutions to the "Please tell me the Who are" problem __xcode

Source: Internet
Author: User
Tags exit in

I have explained in previous blogs how to use the command line to manipulate git, which can greatly improve our productivity. can refer to "Git learning Notes" "Git Learning Notes-advanced" and other articles. In fact, for the same tool, we have different ways to use, today we will learn how to use the Xcode with Git, it is more convenient to use. At the same time for a common problem in a xcode to solve.

When we create a project in Xcode, we can tick the source control:create git repository on option to indicate that the project can be used as a git repository. However, after the successful creation of the project, the following warning appears:



The above problem indicates that GIT is not configured for this project. You can't do all sorts of git operations, the solution is as follows: I use the command line to do the following (more convenient).

(1) into the project root directory, there is a. git hidden file, using the Ls-a command to see:

.


(2) Enter the. git file, inside can see a config file, using the Mac with Vim edit config file. Config file is the configuration file for Git.



.


(3) Edit config file and add the following at the end:

[user] name = Chenyufeng Email = Fill in your mailbox here

Name can be filled in the GIT user name, email fill in your mailbox, if you need to submit code to GitHub, it is best to fill in your GitHub account mailbox.

Finally save exit. How to save the exit in Vim.

Knock Esc key--> out: Colon--> respectively knock W q--> knock enter. You can save the exit.


(4) for the I/are, this warning, we can configure the above steps. There are no other solutions for the moment, and this is necessary for each project. Of course, if you don't want to use Xcode's own git, don't bother with this warning.


Here's a description of the visualization of Git in the Xcode.

The source Control menu in Xcode is all that git can do, and basically meets most of our git requirements:



"1" as the figure can see we can create new branches, switch branches, merge branches, configuration and other operations.



In the configuration configuration, you can view our remote warehouses, branches, and so on. You can also visualize the configuration additions.



"2" The second option check out, which is to check out the code, is equivalent to the clone code from the remote warehouse.



A "3" commit is a code that visually displays the changes you have modified and the previous version.



The push below "4" is to submit code to the remote repository, and you can select the branch you want to submit:



"5" below the pull is to pull the code from the remote warehouse, pull can also select the branch. Personal advice before push to pull first, if there are conflicts can be resolved locally, do not let their own code "pollution" remote warehouse ...



"6" Discard all changes is to make all current changes to the code disappear, back to the state of the last commit. Of course, this operation needs to be cautious.



The final history of "7" can see all the submission records.



The third button in the upper-right corner of "8" Xcode can display the version control editor to quickly see the difference between your current code and any previous version.





To sum up, the git operation in Xcode is basically as described above, it should be said to be very convenient, other usage details also need to study and try in the actual development continuously. But Xcode's own git is just a subset of the command-line git feature, and personal advice is to start with git or from the command line. Current development I am combining the use of both to complement each other.


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.