Get git ( Udacity classroom, WIP )

5th June 2016

move to desktop directory = cd desktop

create directory called hellohello = mkdir hellohello

create a file called hello.html = touch hello.html

create git within the folder = git init

Add files into the staging area = git add hello.html

remove file from staging area = git reset hello.html

commit files = git commit hello.html -m “Add messsage here”

Check git commits = git log

check file status = git status

checkout any version = git checkout 08c96995a3a0b21ee929f21e91ab3d018a348485

Screen Shot 2016-06-12 at 10.14.09 PM.png

go back to master = git checkout master

Use git reflog to find the hashes of previously checked out commits.

Screen Shot 2016-06-12 at 10.16.23 PM.png

So after git add hello.html, and you do git commit hello.html, sublime is supposed to open. But mine doesnt, till i do this

git config –global core.editor ‘/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n -w’

    -W  Causes open to wait until the applications it opens (or that were already open) have

         exited.  Use with the -n flag to allow open to function as an appropriate app for the

         $EDITOR environment variable.

     -n  Open a new instance of the application(s) even if one is already running.