1 [!] *mepy: Working in progress* [!]
5 when using git this is a reminder of commands to run and best practices
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
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)
18 (optional) `cd ` + somewhere in your disk
20 `git clone ` + repo url
23 // You know what to do
26 `git add` + files you want to "take note" of.
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").
30 When committing you are required to add a comment to your "save file" (commit).
31 Like "I added the test.png file".
34 When you are done committing all your stuff, you want to share it with other. So you push on the remote repository (directory).
36 So you just `git push`.
41 - what you modify in the repository
42 - what files you add to your commit
43 - when pushing, what are you actually pushing
46 When doing `git commit` best thing to do is to add ` -m "<comment here, without brackets>"`
48 Like this: `git commit -m "added test.png"`.
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.
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")
59 To quit without saving/writing: `q!` (e.g. you want to exit)