Sync code to Huawei Cloud git repository

1. Create a project and create a git warehouse in the directory where the project is located. 2. Create a
new warehouse on Huawei Cloud, set the SSH key, and get the SSH address of the warehouse.
Among them, the process of obtaining and adding ssh keys:
(1) After entering Git Bash Here in the local warehouse directory, use instructions to generate a key pair.
Insert picture description here
(2) View files
Insert picture description here

(3) Copy the public key to the server
Insert picture description here

(4) Add personal public key

3. Pull down the git warehouse on Huawei Cloud first, in the local warehouse directory

git pull SSH地址 --allow-unrelated-histories

--allow-unrelated-historiesIt must be added, otherwise it cannot be operated.

4. Then you can submit the code to Huawei Cloud

Attachment: Coherent operation
(1) Build your own local library first, then add the remote address

git init
git config --global user.name 用户名
git config --global user.email  邮箱
git remote add origin SSH地址
git pull origin master
git push origin master

(2) Clone the remote library directly without building a local library

git clone SSH地址
git config --global usre.name 用户名
git config --global usre.email  邮箱
git pull origin master
git push origin master

Guess you like

Origin blog.csdn.net/qq_43639081/article/details/109099818