sainture
11/13/2017 - 12:15 AM

git remote

add, remove, get info for remote repositories

# To see which remote servers you have configured, you can run the git remote command
# lists the shortnames of each remote handle you’ve specified
  git remote 
  
# You can also specify -v, which shows you the URLs that Git has stored for the shortname
  git remote -v
  

# Add remote repositories 
# We’ve mentioned and given some demonstrations of how the git clone command implicitly adds the origin remote for you. Here’s how to add a new remote explicitly. To add a new remote Git repository as a shortname you can reference easily, run
  git remote add pb https://github.com/paulboone/ticgit
# Now you can use the string pb on the command line in lieu of the whole URL.


# inspecting a remote
# If you want to see more information about a particular remote, you can use the git remote show <remote> command.
  git remote show origin


# renaming and removing remotes
# You can run git remote rename to change a remote’s shortname. For instance, if you want to rename pb to paul, you can do so with
  git remote rename pb paul
  
# If you want to remove a remote for some reason, you’ve moved the server or are no longer using a particular mirror, or perhaps a contributor isn’t contributing anymore, you can either use git remote remove or git remote rm
  git remote remove paul