Skip to content

Git remote management

Git remote management involves handling the connections between local repositories and their counterparts hosted on remote servers. These connections, termed "remotes," allow for version control operations such as fetching, pulling, and pushing changes^[600-developer-tools-git-git-command.md].

Managing Remotes

To establish a connection, a remote repository must be added using the remote's URL^[600-developer-tools-git-git-command.md]. It is common practice to assign a specific name, such as upstream, to distinguish different repositories^[600-developer-tools-git-git-command.md].

Users can view existing connections with git remote -v, which lists the fetch and push URLs for each remote, typically showing origin by default^[600-developer-tools-git-git-command.md].

Branch Tracking

Branch tracking associates a local branch with a specific remote branch, simplifying push and pull operations^[600-developer-tools-git-git-command.md]. This relationship can be established when creating a new branch or set later on an existing branch^[600-developer-tools-git-git-command.md].

Commands allow for managing these tracking relationships, including setting the upstream branch or unsetting it to stop tracking^[600-developer-tools-git-git-command.md].

Remote Operations

Interaction with remote repositories generally falls into three categories^[600-developer-tools-git-git-command.md]:

  • Pulling: git pull downloads a specific remote branch and merges it into the currently checked-out local branch^[600-developer-tools-git-git-command.md].
  • Pushing: git push uploads local branch commits to the remote repository^[600-developer-tools-git-git-command.md].
  • Deleting: It is possible to delete a branch on the remote server by pushing an empty source to the target destination^[600-developer-tools-git-git-command.md].
  • [[Git]]
  • [[Version Control]]
  • [[Branching]]
  • [[Merging]]

Sources

^[600-developer-tools-git-git-command.md]