Simple operation git to upload local code to code cloud

First, you need to download the git client, skip~

  1. Create a folder GiteeStore
  2. Enter the created folder, right-click to select Git Bash Here, and then enter git init in the console, a .git file will appear
  3. Copy the address of your new warehouse on Code Cloud
  4. Enter git remote add origin https://gitee.com/xmOneKelo/shu-tong.git in the console to associate the local warehouse with the code cloud remote warehouse. If the error remote origin already exists is reported , the solution: enter git remote rm origin and then enter git remote add origin https://gitee.com/xmOneKelo/shu-tong.git
  5. Put the file you want to upload into the newly created folder (I put it in a cs.html file), enter git add . If The file will have its original line endings in your working directory appears The problem is because: from someone else Download it via git clone on the github address, and push it to your own github, then the error message shown above will appear, to solve:
    1. git rm -r --cached .
    2. git config core.autocrlf false 
    3. git add .

  6. Use git commit -m 'Describe newly added file content' (that is, comments) (save the file to the local warehouse)
  7. Continue to enter git push origin master in the console to push the local warehouse to the remote warehouse. Here, you need to enter the user name and password in turn (that is, the account and password when logging in to gitee). The successful result is shown in the following figure:

Guess you like

Origin blog.csdn.net/weixin_46319117/article/details/119799005