Managing remote repositories
When collaborating on any project managed with Git, you will interact often with a constant set of other repositories; for example, in an integration-manager workflow it would be (at least) the canonical blessed repository of a project. In many cases, you will interact with more than one remote repository.
Git allows us to save the information about a remote repository (in short: remote) in the config
file, giving it a nickname (a shorthand name). Such information can be managed with the git remote
command.
Note
There are also two legacy mechanisms to store repository shorthand:
- A named file in
.git/remotes
—the name of this file will be shorthand for remote. This file can contain information about the URL or URLs, and fetch and push refspecs. - A named file in
.git/branches
—the name of this file will be shorthand for remote. The contents of this file are just an URL for the repository, optionally followed by#
and the branch name.
Neither of those mechanisms...