git remotes

Simple commands needed for working with multiple remotes in git.

List of remotes

git remote -v

Add a remote

git remote add remoteName http://url

Rename a remote

git remote rename oldname newname

Checkout a remote branch

git checkout -b branchname remotename/branchname

Delete a remote

git remote rm remotename

Set a new location for a remote

git remote set-url remoteName  url
// Better yet use ssh style
git remote set-url origin git@github.com:user/repo.git

Fetch or pull all remotes use --all

Set the upstream tracking for a branch
On first push use -u
-or-

git fetch --all  //This is done to make sure you have the new remotes locally.
git branch --set-upstream-to remotename/branchname

Delete branches on a remote (just precede the branchname with a :)

git push remotename :branchname

section: