1.Install git
Official website address: https://git-scm.com
The installation process is omitted (all next step, you can change the installation path), or move to other installation tutorials.
2. Open git
Right-click on the desktop and click Git Bash Here
3.Open gitee
1) Configure public key
Click Account Management --> SSH Public Key-->How to Generate a Public Key
See how to generate an SSH public key
ssh-keygen -t ed25519 -C "Gitee SSH Key"
Paste this command into git and execute it by pressing Enter three times.
enter this path
Open it with notepad, copy the content, and return to gitee
Write the title as you like and paste the content you just copied into the public key
After adding, enter in the terminal
ssh -T [email protected]
Enter yes to see the installation is successful
2) Create a new warehouse
If you don’t need to create a new warehouse, you don’t need this operation. We will use it later. (Just take a look, no operation required)
Here are some commonly used git commands (just take a look, no operation required)
Continue from here:
Git global settings (only need to be configured once)
git config --global user.name "用户名"
git config --global user.email "邮箱"
3) Download the remote warehouse
Open the gitee repository and copy it
git clone [email protected]:yicode_gitee/ros-work.git
Enter the above command in git: git clone
The above is the successful cloning
Enter the folder and open it with git
Add a new folder and add a file
Uploading only requires four steps :
git pull origin develop
git add .
git commit -m "提交说明"
git push origin develop
If you find an error when executing the fourth step, don't panic.
Because the local branch is master and the remote branch is develop
So it needs to be changed
git push origin master:develop
ok, we are successful here, then we return to gitee to check
Done! ! !
---------------------------------------------------------------------------------------------------------------------------------
If you are not using git for the first time, you can use the following command:
Update remote data to local warehouse
git pull origin develop
Add modifications to local repository
git add .
Submit modified files + instructions
git commit -m "提交说明"
Synchronize again (insurance)
git pull origin develop
upload
git push origin develop