Skip to the content.

git remote

List Remote

git remote [-v|--verbose]

Add a Remote

git remote add <name> <url>

Remove a Remote

git remote rm|remove <name>

Rename a Remote

git remote rename <old-name> <new-name>

Get Remote URLs

git remote get-url <name>

Set Remote URLs

git remote set-url <name> <url>

Fetch From Remote

git fetch

Speficify remote repo and/or branch:

git fetch <remote=origin> <branch=master>

Pull From Remote

git pull = git fetch + git merge

git pull

Speficify remote repo and/or branch:

git pull <remote=origin> <branch=master>

Push To Remote

Default Action

git push

Configure default action:

git config push.default simple

Speficify Repo/Branch

git push <remote=origin> <branch=master>

Force to Push

Disable checks:

git push -f|--force <remote=origin> <branch=master>

Delete Remote Branch

git push [-f] <remote-repo> :<remote-branch>

References