correctly formatted the text.
[libreriscv.git] / HDL_workflow / git_checklist.mdwn
1 [!] *mepy: Working in progress* [!]
2
3 # git checklist
4
5 when using git this is a reminder of commands to run and best practices
6
7 ## How does working with git looks like
8 * You download a directory with project files in it
9 * Modify some files, add others
10 * Upload your work so other can take advantage of it
11
12 In git you do this by:
13
14 * *Cloning* a repository (aka downloading stuff)
15 * *Committing* your local changes (aka you "take note" of what you did. e.g. modified some files, added new files, deleted some files and so on)
16 * *Pushing* your work online (aka uploading online)
17
18 ## Cloning
19 (optional) `cd ` + somewhere in your disk
20 `git clone ` + repo url
21
22 ## Making changes
23 *// You know what to do*
24
25 ## Committing
26 `git add` + files you want to "take note" of.
27
28 E.g. `git add test.png` will take note of the “test.png" file for when you will want to commit your work. (Committing your work is like saving in a videogame. When you are good with what you have done, you save the stage of the adventure).
29
30 When committing you are required to add a comment to your "save file" (commit).
31 Like ~~"I added the test.png file"~~.
32 Ahah, I was kidding. Remember:
33 > the git message is for WHY you did what you did.
34 >
35 > not what ACTION was done on what file.
36
37 ## Pushing
38 When you are done committing all your stuff, you want to share it with other. So you push on the remote repository (directory).
39
40 So you just `git push`.
41
42
43 ### Notes 1
44 Pay attention to:
45
46 * what you modify in the repository
47 * what files you add to your commit
48 * when pushing, what are you actually pushing
49
50 ### Notes 2
51 When doing `git commit` best thing to do is to add ` -m "<comment here, without brackets>"`
52
53 Like this: `git commit -m "added test.png"`.
54
55 If you omit the -m option, a text editor will appear to let you insert a commit message. Sometimes is useful to let git open the editor. e.g. for long comments or comments with quotes in it.
56
57 If `vim` editor opens (you get stuck into something you do not know how to exit from), remember:
58
59 * type `i` to "insert text".
60 * when you are doing typing some text, press the esc key on the keyboard
61 * if you want to save the comment/text, press `w` (means "write")
62 * to quit, press `q`
63
64 You are done.
65 To quit without saving/writing: `q!` (e.g. you want to exit)