Populated the page with general git info and commands
[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 - *Cloning* a repository (aka downloading stuff)
14 - *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)
15 - *Pushing* your work online (aka uploading online)
16
17 ## Cloning
18 (optional) `cd ` + somewhere in your disk
19
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 your "enjoyment").
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
33 ## Pushing
34 When you are done committing all your stuff, you want to share it with other. So you push on the remote repository (directory).
35
36 So you just `git push`.
37
38
39 ### Notes 1
40 Pay attention to:
41 - what you modify in the repository
42 - what files you add to your commit
43 - when pushing, what are you actually pushing
44
45 ### Notes 2
46 When doing `git commit` best thing to do is to add ` -m "<comment here, without brackets>"`
47
48 Like this: `git commit -m "added test.png"`.
49
50 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.
51
52 If `vim` editor opens (you get stuck into something you do not know how to exit from), remember:
53 - type `i` to "insert text".
54 - when you are doing typing some text, press the esc key on the keyboard
55 - if you want to save the comment/text, press `w` (means "write")
56 - to quit, press `q`
57 You are done.
58
59 To quit without saving/writing: `q!` (e.g. you want to exit)