> For the complete documentation index, see [llms.txt](https://kathfoss.gitbook.io/git/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kathfoss.gitbook.io/git/commands/synchronizing.md).

# Synchronizing

## Synchronizing Local or/and Remote Repo

* **`git remote add <alias> <url>`**

  -Add a remote repo<br>
* **`git remote`**

  -View all remote connections. Add -v flag to view URLs.<br>
* **`git remote remove`**

  -Remove a connection<br>
* **`git remote rename <old> <new>`**

  -Rename a connection<br>
* **`git fetch <alias>`**

  -Fetch all branches from remote repo (no merge)<br>
* **`git fetch <alias> <branch>`**

  -Fetch a specific branch<br>
* **`git pull`**

  -Fetch the remote repo's copy of the current branch, then merge<br>
* **`git pull --rebase <alias>`**

  -Move (rebase) your local changes onto the top of new changes made to it the remote repo (for clean, linear history)<br>
* **`git push <alias> <branch>`**

  -Upload to a branch (can then pull request)&#x20;
