git cannot push files (the whole set is renewed) to solve 90% of the problems

The following is recommended to use if the problem cannot be solved

First create a new file and clone the file in the previous git

Enter the newly created folder, that is, enter "gitspace", click the right mouse button, select Git Bash Here
for basic configuration, as the basic configuration of git, the function is to tell git who you are, and the information you enter will appear in the commit you created In, use the following two commands:

  git config --global user.name "你的名字或昵称"

  git config --global user.email "你的邮箱"
  1. Execute the following command in the gitspace folder to complete the initialization

    git init

    git remote add origin <your project address> //Note: The project address format is: https://gitee.com/xxx/xxx.git or [email protected]:xxx/xxx.git

If the error message shows that the remote source already exists, enter
git remote remove origin

Re-add new source after deleting

  1. If you want to clone, just execute the command

    git clone <project address>

A pop-up window will pop up, enter the account name and password of Code Cloud and
enter the password and the cloning will begin

  1. Enter the directory of your already initialized or cloned project and execute it
    . Update the project from the server, because it has been cloned , so there is no need to update
    git pull origin master 
  1. Make some modifications, such as adding a "description.txt" file
  2. Execute the following command to complete the first submission
      git add .

      git commit -m “安装教程测试”

      git push origin master  

Note: There are two submission commands, git push origin master (normal submission) and git push origin master -f (mandatory submission)

Perform mandatory submission if normal submission is unsuccessful

It should have succeeded here

After that, copy the code to be changed here and submit it again.

Guess you like

Origin blog.csdn.net/weixin_50001396/article/details/112341294