The first recorded use git pull Warehouse Code (Mac version / edition rookie / wrong, please correct me)

This is the first time I write a blog. He considered himself a note, recorded for the first time pulling the difficult process of code. Great God automatically ignored, the first play of the white reference.

Try to write very detailed point ha.
From my own experience, it is mainly to understand the general process of pulling the code, this is very important!
Probably look at is the following steps:
1. When you have a code repository. Probably as shown below:
Here Insert Picture Description
2. This Fei Chang important step! ! ! SSH Key Configuration

Step One: Download gitlab private key. Usually the upper right corner there is a picture click gitkey click Download.
Step: The first step to download the private key file to '~ / .ssh' directory.
Some computer does not ssh file. This requires us to manually download, open the terminal and type:
ssh-keygen -t rsa -C 'your mailbox (better not write qq-mail, if the project is the company's best to write E-mail)'
then all the way round to put ssh file is created.
Then cd ~ / .ssh
then touch config This step is to create a config file.

Third Step: Review '~ / .ssh / config' file
the following contents is added into the config file:

Host gitlab.oneitfarm.com
HostName gitlab.oneitfarm.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/oneitfarm
port 29622

This step is done directly modify the terminal:

1. vim config//这是进入config文件编辑
2. i//输入i进入编辑界面
3. 将上述内容加入 。肥肠小心的是  IdentityFile ~/.ssh/oneitfarm这行 oneitfarm就是你的私钥文件名,必须要跟你下载的私钥文件的文件名和路径保持一模一样哦!!!
4. 编辑好后 esc 再输入:wq!保存

Step 4: After successfully saved, at the command line 'chmod 600 oneitfarm' to
(Oneitfarm you have to change the corresponding private key file name)
After configuring the ssh keys, you can enter the warehouse development space in the warehouse were pulled run projects it

3. Pull the code
the most important thing is to first create a folder to store the code you pull storage. I chose the desktop.
Then enter the terminal to the directory (which I do not say it cd path)
then git clone warehouse address (I mark the first step)
and then yes
and then wait for success on it. As shown below
Here Insert Picture Description

Written by very professional, correct me hope.

Published an original article · won praise 2 · views 11

Guess you like

Origin blog.csdn.net/weixin_43015194/article/details/104449727