A git user may add or modify a remote in their repository via the git remote
subcommand. Most commonly (e.g. in the case the user has cloned from a popular git service such as GitLab or GitHub) git repositories have a remote named origin
which is the default remote operated on. We can add extra URLs that point to other servers hosting a copy of the repository via git remote set-url --add origin <url>
.
Alternatively, one can also manually edit .git/config
in the root of the repository. An example of what may be in the config regarding the remote origin is
[remote "origin"]
url = [email protected]:<user>/<repo_name>.git
fetch = +refs/heads/*:refs/remotes/origin/*