Docunext

  • About

Git Remote Improvements

January 30th, 2011

The git remote sub-command has received some improvements recently:

Here's output from a recent version of git-core:

# git remote -h
usage: git remote [-v | --verbose]
   or: git remote add [-t ] [-m ] [-f] [--mirror]  
   or: git remote rename  
   or: git remote rm 
   or: git remote set-head  [-a | -d | ]
   or: git remote show [-n] 
   or: git remote prune [-n | --dry-run] 
   or: git remote [-v | --verbose] update [-p | --prune] [group]

    -v, --verbose         be verbose

And the latest version (or the current version available in Debian Squeeze):


# git remote -h
usage: git remote [-v | --verbose]
   or: git remote add [-t ] [-m ] [-f] [--mirror]  
   or: git remote rename  
   or: git remote rm 
   or: git remote set-head  (-a | -d | )
   or: git remote [-v | --verbose] show [-n] 
   or: git remote prune [-n | --dry-run] 
   or: git remote [-v | --verbose] update [-p | --prune] [group | remote]
   or: git remote set-url   []
   or: git remote set-url --add  
   or: git remote set-url --delete  

    -v, --verbose         be verbose; must be placed before a subcommand

Most useful to me at the moment is the ability to change the URL for remotes, as I recently setup a gitosis server, then decided to change the hostname pointing to it. Thankfully, this makes is super easy.

sudo git remote set-url origin gitosis@git.example.com:mygitproject.git
Yearly Indexes: 2010 2003 2005 2006 2007 2008 2009 2004 2011 2012 2013 2015 2019 2020