๐ŸŒ RemoteCommonly used

How to add a remote repository in Git

Connect your local repository to a remote like GitHub or GitLab.

Add a remote called "origin"
git remote add origin https://github.com/user/repo.git

Adds a remote named "origin" pointing to the GitHub repository.

When to use: After git init, to connect to a remote repository.

List all remotes
git remote -v

Shows all configured remotes with their fetch and push URLs.

Remove a remote
git remote remove origin

Disconnects the remote named "origin" from this repository.

Rename a remote
git remote rename origin upstream

Renames the remote "origin" to "upstream".

โ† Back to Git Reference