What is a remote
Platforms like Github are really useful!
They're like a cloud service, but with enhanced features specifically for code. A well written history has saved me quite a bit of time in the past.
The remote of a repo is the location where it is stored.
Typically a url like github.com/org/your-project.
Less known is that you can have multiple remotes.
Adding a new remote
- Create a new (empty!) repo
Connect your local repo to the new remote.
You'll need to name the remote (the default one is called origin), for example "personal" or "gitlab" (another provider).
Command:git remote add name-for-remote repo-url
Example:git remote add personal github.com/org/your-project-
Push to the remote of your choosing
- Set a default:
git config push.default remote-name - Or specify the remote to push to: git push remote-name branch-name
- Set a default:
Top comments (0)