Xcode connects to Git

Source: Internet
Author: User

Xcode has integrated git, hooked up with Git when creating a new project, and then follow the steps below to make Xcode and Git@osc connect.

First step: genetic ssh secret key

Open Terminal Command tool, enter command: ssh-keygen-t rsa-c "[Email protected]"

Note that there are no spaces for Ssh-keygen. Screen output:

Generating public/private RSA key pair.

Enter file in which to save the key (/users/diaosi/.ssh/id_rsa):diaosi

Enter the generated key file name above, such as diaosi, screen output:

Enter passphrase (empty for no passphrase): Enter password

Enter same passphrase again: Confirm password

Your identification have been saved in Diaosi.

Your public key had been saved in Diaosi.pub.

The key fingerprint is:

25:fd:01:00:89:98:49:bf:2e:ac:32:2e:d2:5d:bf:98 diaosi@gmail.com

The key ' s Randomart image is:

+--[RSA 2048]----+

| .. + .. O ... |

| +..  . .     . |

|   . .    O. |

|   . O.   . |

|   .    S. |

| .  .          . |

|. O ..... |

|= ..... O. |

|*o E.. |

+-----------------+

The screen prompts to generate the key file successfully, saved in the/users/diaosi folder.

Step two: Put Diaosi.pub add Git@osc to the content in the SSH in the key

Step three: Add SSH and connect

Input command: Ssh-add ~/diaosi

~/diaosi is the key file path that was just generated, the screen output:

Enter passphrase For/users/diaosi/diaosi: Enter password

Identity added:/users/diaosi/diaosi (/users/diaosi/diaosi)

Input command SSH-T [email protected], screen output:

The authenticity of host ' git.oschina.net (58.215.179.44) ' can ' t be established.

RSA key fingerprint is 14:B8:B8:0B:C2:B2:5E:AE:F2:21:F8:18:4D:3A:BE:FC.

Is you sure want to continue connecting (yes/no)? Yes(enter Yes), screen output:

warning:permanently added ' git.oschina.net,58.215.179.44 ' (RSA) to the list of known hosts.

Welcome to Git@osc, old left!

Fourth step: Set up your personal information

Enter the command:

git config–global user.name "Diaosi"

git config–global user.email diaosi@gmail.com

Fifth step: Set up the project

Gets the project path on the Git@osc.

Input command: CD project folder

Input command: Git remote add origin [email protected]:heqings/fitness.git

Input command: Git pull-u origin master//pull project from Git@osc

Input command: Git push-u origin master//Submit Project

Sixth step: Xcode Integrated

In Xcode, submit your code to Git@osc before submitting it to local git, or Xcode will prompt you.

Select file on the project or file to submit to the local, it should be noted that the project user data is not submitted to git, because it changes in real time, local and remote do not submit, otherwise push when prompted to have the file is not committed.

Do not submit the above file.

Submit the project to the Local:

File->source Control->commit

Submit the project to Git@osc:

File->source Control->push

Click the push button.

Original: http://blog.csdn.net/ouyangtianhan/article/details/17510009

Xcode connects to Git

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.