git remote
Manage connections to remote repositories
Practical example
git remote -v # origin https://github.com/user/repo.git (fetch) # origin https://github.com/user/repo.git (push) git remote add upstream https://github.com/original/repo.git
Command overview & how it works
Remotes are shorthand names for URLs to hosted repositories. The default remote after cloning is 'origin', which points to the URL you cloned from. Use git remote -v to list all remotes with their fetch and push URLs (they can be different). Use git remote add <name> <url> to connect a new remote, git remote remove <name> to delete one, and git remote rename <old> <new> to rename. Use git remote set-url <name> <new-url> to change a remote's URL without removing and re-adding it. Use git remote show <name> to see detailed information about a remote's branches, tracking relationships, and whether it is reachable. Multiple remotes are common when working with forks — origin points to your fork, upstream points to the original repository.
Master upstream tracking, SSH auth, and team workflows
Upstream sync strategies, merge vs rebase on pull, and semantic release tagging in the 97-page course — ₹499.
Practical tips
- Use git remote -v to see both fetch and push URLs — they can point to different addresses.
- In a fork workflow, keep origin pointing at your fork and add the original project as upstream: git remote add upstream <url>.
- Change a remote's URL with git remote set-url origin <new-url> instead of deleting and re-adding it.
Deep-dive guides & tutorials
In-depth walkthroughs and practical scenarios related to git remote
- Guide
Git SSH Setup: Secure Authentication for Remote Repositories
Set up SSH keys for password-less, secure Git operations. Connect to GitHub, GitLab, and any Git server without typing credentials.
5 min readRead guide - Guide
Git Submodules: Managing Dependencies Across Repositories
Include one repository inside another with git submodules. A practical guide to adding, updating, and working with nested repos.
7 min readRead guide - Tutorial
Git Tagging: Versioning Your Project Milestones
Mark important commits with tags for releases, versions, and milestones. Learn lightweight vs annotated tags and how to share them.
4 min readRead guide
Related commands
More from Remote Repositories