← Cheat Sheets
Git Remotes and Collaboration
Work with remote repositories.
# Git Remotes and Collaboration
Work with remote repositories.
```bash
git clone <url> # copy a repository
git remote -v # list remotes
git remote add origin <url> # add a remote
git remote set-url origin <url> # change its URL
git fetch # download without merging
git pull --rebase # fetch and replay local commits
git push -u origin feature # push and set upstream
git push --force-with-lease # safer force push
git push origin --delete feature # delete a remote branch
git branch -vv # show tracking branches
git remote prune origin # remove stale remote branches
```