Analyzing the following error git errors

Analyze the following error PS D:\Hexo> git remote add origin https://github.com/zyziga/Hexo.git fatal: remote origin already exists.

analysis error

This error message indicates that you tried to run a git command in the D:\Hexo directory, which involves adding a remote origin. However, this remote origin already exists, so the command to add the remote branch fails.

More specifically, this error message indicates that the git remote add origin https://github.com/zyziga/Hexo.git command has been run in the D:\Hexo directory , but an error occurred while adding the remote branch. The information given in the error message is "remote origin already exists", which means that the remote origin already exists. This may be because you have added a remote branch named origin in the D:\Hexo directory before, or because You have run the git fetch command in the D:\Hexo directory and loaded the remote branch into the local branch.

solve

To fix this, you can delete the remote origin with the following command:

git remote remove origin  

Then, you can re-run the git remote add origin https://github.com/zyziga/Hexo.git command to add a new remote origin branch.

Guess you like

Origin blog.csdn.net/m0_59281987/article/details/129915278