BlockLune's Blog

Home Tags About

Simple Git Tutorial: Working with Remote Server

published at 2024-01-29
git version control

Use remote servers to work with collaborators better.

# connects to a remote server. Usually <server_name> is `origin`
git remote add <server_name> <server>

# removes a specific remote server
git remote remove <server_name>

# shows all the remote servers
git remote -v

# renames
git remote rename <old_server_name> <new_server_name>

# shows some info about a specific remote server
git remote show <server_name>

# pushes files
git push -u <server_name> <branch> # or `git push --set-upstream <server_name> <branch>`

# fetches files
git fetch  # from the default remote upstream repo
git fetch <server_name>  # from a specific remote upstream repo

# combines the `fetch` and `merge` together
git pull