Solve the problem that the scoretre clone github project is slow. Usage of the git remote command

Video tutorial: https://www.bilibili.com/video/BV1aE411p7Cd

https://gitee.com pull git project

Then scoretree clones the gitee project

Then open the console in scoretree and type git remote set-url origin <newurl>

Or go to the git folder under the project to modify the clone address

Attached:

Usage of git remote command

Source: https://www.cnblogs.com/fengff/p/11225711.html

 

View the information of the associated remote warehouse

    # View the name of the associated remote warehouse
    git remote
    # View the details of the associated remote warehouse
    git remote -v

Add

the name of the associated remote warehouse of the remote warehouse The default is usually origin, of course, you can set it to other The name.

When downloading a project to the local via git clone, the .git directory in the project folder is the repository directory.

The config file in the .git directory has the associated configuration of the remote warehouse.

    # git_url is the url of your remote warehouse, you can use the http protocol or ssh (git) protocol
    git remote add origin <url>

delete the association of the remote warehouse

git remote remove <name>

modify the association of the remote warehouse For

example, before you associate the remote The protocol used by the warehouse is http, and you want to change the URL of the associated remote warehouse to the ssh protocol.

There are three main ways to modify the associated remote warehouse.

The first one: use the git remote set-url command to update the URL of the remote warehouse.

Git remote set-url origin <newurl>

The second kind: delete the previously associated remote warehouse first, and then add the new remote warehouse association

    # Delete the associated remote Warehouse
    git remote remove <name>
     
    # Add new remote warehouse association
    git remote add <name> <url>

The name of the remote repository is recommended to use the default name origin.

The third type: directly modify the config configuration file in the .git directory under the project directory.

Guess you like

Origin www.cnblogs.com/LiTZen/p/12708284.html