Clone Github project command under Linux system


1. Install git

Ubuntuinstallation instructions

apt-get install git

CentOSinstallation instructions

yum install git 

View Gitversion information

git version

insert image description here


2. Set username and email

 git config --global user.name = “用户名或者用户ID”
 git config --global user.email = 邮箱

insert image description here


3. Generate key

ssh-keygen -C 邮箱 -t rsa

Press directly in the middle enterto default

insert image description here


4. Copy the key

Change to the target directory

cd ~/.ssh

View the files in the directory

ls 

insert image description here
where id_rsarepresents the private key and id_rsa.pubrepresents the public key


Open the public key and copy the entire content

code id_rsa.pub

insert image description here


5. Configure Github SSH keys

Open Github and enter Settings, findSSH and GPU keys

insert image description here

1 1 Take the one Titleat 1 at will, and paste the content of the public keyto2 22 in the frame.

insert image description here

The following appearance means that the addition is successful

insert image description here


6. Clone the project

Find the target project and copy SSHthe content

insert image description here

switch to target folder

cd /hy-tmp

clone project

git clone [email protected]:ultralytics/ultralytics.git

Cloned successfully

insert image description here


references

https://blog.csdn.net/weixin_45681272/article/details/126213114

Guess you like

Origin blog.csdn.net/weixin_43694096/article/details/131378899