]> rtime.felk.cvut.cz Git - hubacji1/oneflow.git/blobdiff - README.md
Remove not working link
[hubacji1/oneflow.git] / README.md
index 74479a8138c5d6637409f8c0f54d2aca757800e4..e1ae342915c828fe9a766e246d635c256b499e95 100644 (file)
--- a/README.md
+++ b/README.md
@@ -29,4 +29,55 @@ that are ready.
 The `git diff` command shows *changes* in not-yet-ready files and `git diff
 --cached` shows *changes* that are ready to be committed.
 
-# Log changes - build repository history
+# Commit - build repository history
+You get ready the files to be commited to the history by `git add FILE`
+command. If you change your mind, you may `git reset FILE` that file.
+
+If only huks of lines in file should be prepared for commiting to the history
+`git add -p FILE` and `git reset -p FILE` can be used respectively.
+
+Before commiting to the history log check twice `git diff --cached` and `git
+diff`.
+
+When sure that staged changes should be commited to the history, use `git
+commit -m'COMMIT MSG'`. For commit messages, some rules are good to keep in
+mind [1][]:
+- Separate subject from body with a blank line.
+- Limit the subject line to 50 characters.
+- Capitalize the subject line.
+- Do not end the subject line with a period.
+- Use the imperative mood in the subject line.
+- Wrap the body at 72 characters.
+- Use the body to explain what and why vs. how.
+
+# Cheat sheet
+Use `git COMMAND --help` for showing the help!
+
+## Init
+- `git clone URL`
+- `git init`
+- `git config user.name "Your Name"`
+- `git config user.email you@example.com`
+- `git config --global user.name "Your Name"`
+- `git config --global user.email you@example.com`
+
+## Explore
+- `git log`
+- `git log --graph`
+- `git log --oneline`
+- `git log --decorate`
+- `git show COMMIT`
+
+## Changes
+- `git diff`
+- `git diff --cached`
+
+## Commit
+- `git add FILE`
+- `git add -p FILE`
+- `git reset FILE`
+- `git reset -p FILE`
+- `git commit -m'COMMIT MSG'`
+- `git commit`
+
+[1]: https://chris.beams.io/posts/git-commit/