Connect Git@Git.oschina.net using Mac OS X terminal

Source: Internet
Author: User

Environment Preparation:
    1. Xcode (direct AppStore download installation)
    2. Git (you can download git installer in http://code.google.com/p/git-osx-installer/, or in https://www.kernel.org/pub/software/scm/git/ Download the source installation. )
Source Installation process:
    1. Unzip the source package

      Tar xjvf git-1.8.3.tar.bz2
    2. Compile

      CD Git-1.8.3./configure--prefix=/usr/localmake
    3. Installation

      sudo make install

Configure git and connect to [email protected]

First step: genetic ssh secret key

Open Terminal, enter

Ssh-keygen-t rsa-c "[Email protected]"

Output text

Generating public/private RSA key pair. Enter file in which to save the key (/USERS/DIAOSI/.SSH/ID_RSA): Shiniv_test Enter the generated key file name above, such as shiniv_test, 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 have 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 [Emai L protected]the Key ' s randomart image is:+--[RSA 2048]----+|. + .. o ...      | |  +.. .  . .     ||    .   . O.    | |     .   O. .   ||    .   S. | | |..          |         | | =....  O.        | | *o    E..       | +-----------------+

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

Step two: Put Diaosi.pub Add the contents of [email protected] the SSH in the key
Address: Http://git.oschina.net/keys/new

Step three: Add SSH and connect

Input command: Ssh-add ~/.ssh

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

Identity added:/users/shiniv/.ssh/(/users/shiniv/.ssh/)

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.

Fourth step: Set up your personal information

Enter the command:

git config–global user.name "Shiniv" git config–global user.email [email protected]
Sync your project to [email protected]
    1. Under your git.oschina.net, create a project.
    2. On your computer, for future management convenience, you should set up a folder for Oschina project management, such as Gitoschina. Store each item in a secondary directory.
    3. Open the command line tool and execute the command:

      CD gitoschina/jbcalendar/           into the project directory git init                            initializes the local library (only needed for the first time) Git remote add origin [email protected]:shiniv/ Shiniv_test.git  Adding an alias for a remote repository
    4. Set up files that need to be ignored, create a new. Gitignore in the project directory, and enter the following

      #排除build目录build/* # Exclude temp nibs and swap files# excludes nib temporary files and swap files *~.nib*.swp# exclude OS X folder display Properties directory. ds_store# exclude Xcode3 Xcode 4 user-defined settings file *.mode1*.mode1v3*.mode2v3*.perspective*.perspectivev3*.pbxuserxcuserdata

      Then continue to submit

      git Add.       Add all files to Repository git commit-a-M "First commit data"    Add all Modify this repository Git pull Origin master      get and merge from remote library to local repository Git push origin master      Pushing changes to the remote library
    5. So far, the new project has been completed.
Update Project

1. Similar to the action when creating the project, open command line tool, execute command

CD xcode/iphone/           into the project directory git Add.       Add all files to Repository git commit-a-M "Here is the submission instructions to fill in, must"    add all modify the repository Git pull Origin master      gets and merges from the remote library to the local repository Git push origin master      pushing changes to the remote library

2. At this point, the update is complete.

Connect using Mac OS X terminal [email protected]

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.