About Git adding, deleting, and changing source addresses

In the last blog, we learned about the basic use of Git. If you have established a remote code base and encountered the problem of modifying the source address of the remote code base, then this blog may help you.

 

1. How to check the source address of the current remote Git library?

$git remote -v
$git remote -version
//The above two methods are to view the source address of the current Git library

 2. At this time, if you want to modify the current source address:

$git remote set-url origin [GIT URL]
//orgin is the current source address name, [GIT URL] is the source address to be modified

 3. Add a new Git repository source address:

$git remote add [NAME] [GIT URL]
//[NAME] is the source address name of the new Git library, and [GIT URL] is the source address of the new Git library

 4. Delete a Git repository source address:

$git remote remove [NAME]
$git remote rm [NAME]
//[NAME] is the source address name of the Git library

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326765737&siteId=291194637