Git Error: fatal: remote origin already exists.

Today, when using git to add a remote GitHub warehouse, you will be prompted with an error: fatal: remote origin already exists

Finally, the solutions are as follows:
1. Delete the remote git warehouse first

$ git remote rm origin

2. Add remote git warehouse

$ git remote add origin [email protected] :FBing/java-code-generator

If an error is reported when git remote RM origin is executed, we can manually modify the contents of the gitconfig file

$ vi .git/config

Similar Posts: