]> rtime.felk.cvut.cz Git - hubacji1/oneflow.git/blob - remote.md
Merge branch 'feature/remote'
[hubacji1/oneflow.git] / remote.md
1 # Remote
2 The repository may be stored on remote, usually a server. The remote is added
3 automatically when `git clone` and needs to be added manually by `git remote
4 add NAME URL` when `git init` used.
5
6 The main remote is usually named `origin`.
7
8 # Update - copy the repository changes
9 When copying repository history to the server, `git push` command is used. If
10 copying from the server to local repository clone, `git pull --rebase` is the
11 proper command.
12
13 This `--rebase` options first download all new changes in repository on server
14 and on top of them then apply local changes. Even that timestamp info is
15 forgotten (so the local changes looks like has been done just after copying
16 repository from server is finished) it is preffered over `git pull` because the
17 history is cleaner.
18
19 # Cheat sheet
20 Use `git COMMAND --help` for showing the help!
21
22 ## Remote
23 - `git remote add NAME URL`
24
25 ## Update
26 - `git push`
27 - `git pull --rebase`