Install git on Mac OS X

Source: Internet
Author: User

1. Install git

Because the Mac git address is invalid.

Compile and install

1. Extract

Tar xjvf git-1.7.4.1.tar.tar.bz2

2. Compile

CD git-1.7.4.1

./Configure -- prefix =/usr/local

Make

3. Install

Sudo make install

 

OK. Which git: Try it ~

Ii. Set SSH

When using SSH links on GitHub, you need to set up SSH

1. Check the SSH key

Cd ~ /. SSH

2. Back up the existing key (if any)

Mkdir key_backup

MV id_rsa * key_backup

3. generate an SSH key

$ Ssh-keygen-t rsa-C jiang.bo.hit@gmail.com

Generating public/private RSA key pair.

Enter file in which to save the key (/users/jiangbo/. Ssh/id_rsa ):

Enter passphrase (empty for no passphrase ):

Enter same passphrase again:

Your identification has been saved in yes.

Your public key has been saved in id_rsa.pub.

The key fingerprint is:

FB: C4: B0: E0: 47: FD: Be: E0: FB: Ea: 73: EF: A8: 29: D5: 22 jiang.bo.hit@gmail.com

The key's randomart image is:

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

|

|

|

|. |

|. S... |

|. OE = o... |

|. + O +... |

|... +... |

| OOB = + O |

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

4. Add the SSH key to GitHub

Log on to the GitHub page, account settings-> SSH public keys-> Add another key

Copy the generated key (id_rsa.pub file) to the input box and save it.

5. Test Link

$ SSH git@github.com.

The authenticity of host 'github. com (207.97.227.239) 'can't be established.

RSA key fingerprint is 16: 27: AC: A5: 76: 28: 2D: 36: 63: 1b: 56: 4d: EB: DF: A6: 48.

Are you sure you want to continue connecting (Yes/No )? Yes

Pty allocation request failed on channel 0

Hi Jiang-bo! You 've successfully authenticated, but GitHub does not provide shell access.

Connection to github.com closed.

Don't worry. This is normal.

3. Set personal information

$ Git config -- global user. Name "Bo Jiang"

$ Git config -- global user. Email "jiang.bo.hit@gmail.com"

Related Article

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.