a nerdy octopus, illustrated by @camerongraphics
This is a cheatsheet to go back to, when lost for some steps in git. It summaries all the cheat sheets present in the different lessons (yet to be updated). I did it for myself at the beginning, but you can take it and use it as it is or as a template for your own.
To be filled in along my -our- journey with new tips/ commands.
$ pwd #show the current directory
$ cd #change directory
$ mkdir #make directory
$ rmdir #remove empty directory
$ ls #list directory
$ touch #creates an empty file (e.g. touch file.txt)
$ cat #print out a file to see out's inside
$ cp #copy a file (e.g. cp file.txt file2.txt)
$ mv #rename a file (e.g. mv file.txt document.txt)
$ rm #delete a file
$ nano #simple text editor to write in a file (CTRL+O and enter to save, CTRL+X to exit)
$ history #shows previous command
$ exit #quit this shell
$ echo #print
$ wc -1 #count lines
$ wc -c #count characters
$ grep Raven #only show the lines with the word "Raven"
$ tr abc def #replace every a with d, every b with e, etc.$ git status #shows what files differ between "current revision"
$ git init #start a new empty git repo in the current directory
$ git checkout #change between branches
$ git add #index the changes I make before commit
$ git restore #restore files from repo
$ git commit #commit the changes in the index into the repository
$ git diff #run a diff between different commits to see difference in the files
$ git log #see the history of all the commitsgit commit -a -m “what your commit is about”, is a way to add, commit and write your commit message out of nano. Very useful, but the file must already exist in the index. This means that the first time you create/add a file to git, you need to do a real “git add” then a “git commit -m”.