git install and SSH Key Management Mac Chapter

Source: Internet
Author: User
Tags git client git clone

1, download the Git client, for: HTTPS://GIT-SCM.COM/DOWNLOAD/MAC2, open the installation package, you can see the interface at this point is: we need to install the. PKG installation package into the system. After I double-clicked the installation package, the results failed to install successfully. The interface is: Here is a pit, although it is very simple problem, but for beginners sometimes headache. Later, on the internet finally found the reason, because this requires permission, so the direct click on the installation is not successful. By holding down the control key, click the pkg file. This will bring up the installer interface. As shown in. Then select open to complete the installation. 3) Create Ssha, check SSH key

Open terminal, run CD ~/.ssh

If there is no file under the path, skip the next step, and if there is an SSH key, you need to make a second backup

B. Back up the existing key (if any)

mkdir Key_backup

MV id_rsa* Key_backup

C,. Generate SSH Key

$ ssh-keygen-t rsa-c [email protected] (registered main mailbox)

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 have been saved in Yes.

Your public key had 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 [email protected]

The key ' s Randomart image is:

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

| |

| |

| |

|       . |

| .     S.. |

| .    Oe=o. |

| .    +o+. |

| ..   +.+.. |

| Oob=+o |

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

4) Add SSH key to coding

A. Open terminal, enter Open ~/.ssh, view id_rsa.pub This file and open copy key value

B, open coding official website, after the successful login, click on the account-ssh public key, enter the value of a step copy, click Submit

5) Create a local repository and initialize

1, the command line open the folder directory of this warehouse or directly create

CD!/(catalogue)

2. Warehouse Initialization

Git init

3. Cloning the project to a local warehouse

git clone URL (project's SSH address)

4. Update remote update to Local:

Open the directory of the local repository first, if the directory of the program folder

Then enter the update Code command as follows:

Git pull

5. Submit Code

git Add. Git commit-m "description" Git push origin Master

FAQs FAQ

The 1.git pull code reported the following error:

Error:your local changes to the following files would is overwritten by merge:

Please, commit your changes or stash them before you can merge.

This means that there is a conflict between the updated content and the locally modified content, either by committing your changes or by temporarily storing the local changes first.

WORKAROUND: Store local content First, Run command: Git stach

Then git pull can

2, Git pull when reported the following error:

Fatal:no remote repository specified. Please, specify either a URL or a

Remote name from which new revisions should is fetched.

Problem: Open path is not correct

Workaround: Open the correct path for this warehouse and update the code

Refer to the following blog post:

1, http://blog.csdn.net/helinlin007/article/details/503586332, http://www.cnblogs.com/ccdev/archive/2012/09/12/ 2682098.HTML3, http://www.runoob.com/git/git-basic-operations.html

git install and SSH Key Management Mac Chapter

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.