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