How to remove the original warehouse git address and clear the git version information of the original project

1. Remove the original warehouse git address

 Use the git remote -v command to check whether it is associated with the new git warehouse address

 git remote rm origin deletes the previous associated git address

Then we use git remote add origin to associate it with the address of the new remote library.

then push

That's it. If submission fails, add -f to force upload. 

Actually, that's all that's needed

git remote remove origin

No need to write the warehouse address later

2. Clear the git version information of the original project

rm -rf .git

Kind tips:

It will not work if you just execute the command in the cmd of the current directory. An error will be reported!

You need to use git bash!

Correct method: right-click git bash in the current directory

 

 

This clears the git information of the project

Then view the project again. The version information of previous git submissions is gone! Clean!

Guess you like

Origin blog.csdn.net/Achong999/article/details/130406294