Post

Git Remote Cheatsheet

Add a Remote:

1
git remote add <name> <url>

List Remotes:

1
git remote -v

Rename a Remote:

1
git remote rename <old_name> <new_name>

Remove a Remote:

1
git remote rm <name>

Show Remote URL:

1
git remote get-url <name>

Set Remote URL:

1
git remote set-url <name> <new_url>

Fetch Changes from a Remote:

1
git fetch <remote_name>

Push Changes to a Remote:

1
git push <remote_name> <branch_name>

Pull Changes from a Remote:

1
git pull <remote_name> <branch_name>

Show Remote Branches:

1
git branch -r

Track a Remote Branch:

1
git checkout -t <remote_name>/<branch_name>

Delete a Remote Branch Locally:

1
git branch -d <branch_name>

Delete a Remote Branch:

1
git push <remote_name> --delete <branch_name>
This post is licensed under CC BY 4.0 by the author.