Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 1.04 KB

HowTo - Git Remote.md

File metadata and controls

53 lines (38 loc) · 1.04 KB

HowTo - Git Remote

REF.: [1] Git - git-remote Documentation
REF.: [2] Git - Working with Remotes


Adding a Remote Repository

git remote add <name> https://path-to/the-project.git
# Note: As a common naming convention "origin" is often used for
# the default remote repository; change this name when you
# add more remote repositories.

Changing a Remote's URL

git remote set-url origin https://path-to/the-project.git
# Remember "origin" is just a name

Listing Existing Remotes

$ git remote
origin
$ git remote -v
origin  https://path-to/the-project.git (fetch)
origin  https://path-to/the-project.git (push)

Renaming a Remote

git remote rename <old_name> <new_name>

Removing a Remote

git remote remove <name>

Inspecting a Remote

git remote show origin
# "It lists the URL for the remote repository as well as the
# tracking branch information." [2]