]> rtime.felk.cvut.cz Git - hubacji1/oneflow.git/blob - README.md
Fix missing status command
[hubacji1/oneflow.git] / README.md
1 # OneFlow playground
2 The purpose of this repo is to play!
3
4 # Git is ...
5 Source Code Management (SCM) and it's great. Check out https://git-scm.com/ for
6 details.
7
8 # Init - do it once per repository
9 You may clone it like `git clone URL` or create one from a folder by `git
10 init`.
11
12 Also, just after first commit, you may be asked to set up your name and email
13 address with `git config ...` command. If `--global` is used the name and/or
14 email will be automatically used for all the commits.
15
16 # Explore - check out the repository history
17 The command that show the whole history is `git log`. The history is build from
18 commits - changes to files in row scale.
19
20 The changes of the commit can be shown by `git show COMMIT_ID`. Where the
21 `COMMIT_ID` is the identifier obtained from `git log` command.
22
23 # Changes - check out before commit
24 The status of the repository can be checked by `git status` command. This
25 allows you to see *new files* that are not yet tracked, *changed files* whose
26 changes are not yet ready to be commited to the log history and *changed files*
27 that are ready.
28
29 The `git diff` command shows *changes* in not-yet-ready files and `git diff
30 --cached` shows *changes* that are ready to be committed.
31
32 # Commit - build repository history
33 You get ready the files to be commited to the history by `git add FILE`
34 command. If you change your mind, you may `git reset FILE` that file.
35
36 If only huks of lines in file should be prepared for commiting to the history
37 `git add -p FILE` and `git reset -p FILE` can be used respectively.
38
39 Before commiting to the history log check twice `git diff --cached` and `git
40 diff`.
41
42 When sure that staged changes should be commited to the history, use `git
43 commit -m'COMMIT MSG'`. For commit messages, some rules are good to keep in
44 mind [1][]:
45 - Separate subject from body with a blank line.
46 - Limit the subject line to 50 characters.
47 - Capitalize the subject line.
48 - Do not end the subject line with a period.
49 - Use the imperative mood in the subject line.
50 - Wrap the body at 72 characters.
51 - Use the body to explain what and why vs. how.
52
53 # Cheat sheet
54 Use `git COMMAND --help` for showing the help!
55
56 ## Init
57 - `git clone URL`
58 - `git init`
59 - `git config user.name "Your Name"`
60 - `git config user.email you@example.com`
61 - `git config --global user.name "Your Name"`
62 - `git config --global user.email you@example.com`
63
64 ## Explore
65 - `git log`
66 - `git log --graph`
67 - `git log --oneline`
68 - `git log --decorate`
69 - `git show COMMIT`
70
71 ## Changes
72 - `git status`
73 - `git diff`
74 - `git diff --cached`
75
76 ## Commit
77 - `git add FILE`
78 - `git add -p FILE`
79 - `git reset FILE`
80 - `git reset -p FILE`
81 - `git commit -m'COMMIT MSG'`
82 - `git commit`
83
84 [1]: https://chris.beams.io/posts/git-commit/