git remote

Updated: 29 March 2024

Initialize a repo with no working directory e.g. a shared repository. Developers can clone our-shared-project.git.

git init --bare <our-shared-project.git>

Change url of remote

git remote set-url origin new-url

Fetch one branch from a remote

git fetch <remote_name> <branch_name>

Rename remote

git remote rename origin origin_bitbucket

Remove remote

git remote remove temp-remote

Add a remote

git remote add origin git@github.com:User/UserRepo.git

Ping a remote by listing it’s references

git ls-remote

Leave a comment