Simple Git Tutorial: Working With Remote Server

Use remote servers to work with collaborators better.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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