space, → | next slide |
← | previous slide |
d | debug mode |
## <ret> | go to slide # |
c | table of contents (vi) |
f | toggle footer |
r | reload slides |
z | toggle help (this) |
$ git config --global user.name "Tom Preston-Werner"
$ git config --global user.email "tom@mojombo.com"
$ git config --global color.ui true
$ cd path/to/repos
$ mkdir hello
$ cd hello
$ ls -al # dir is empty $ git init # initialize git repo $ ls -al # new .git dir
$ vim hello.sh
$ vim goodbye.sh
$ git add hello.sh # add content to index $ git add goodbye.sh # add content to index
$ git status
$ git commit # make a commit
$ git log
$ vim hello.sh # modify the file
$ git status
$ git diff
$ git add -p
$ git diff --staged
$ git commit -m "more ambition!"
$ git branch
$ git branch uppercase
$ git checkout uppercase
$ vim hello.sh
$ git add -p
$ git commit -m 'convert string to uppercase'
$ git branch -v
$ cat hello.sh # uppercase version $ git checkout master $ cat hello.sh # master version
$ git diff master uppercase
$ git merge uppercase
$ git branch -d uppercase
$ git checkout -b greeting
$ vim hello.sh
$ vim goodbye.sh
$ git add -p
$ git commit -m 'new greetings'
$ git checkout master
$ vim README $ git add -p # nothing to review! $ git status # find out why
$ git add . # add everything! $ git status # see that it worked
$ vim README
$ git status # make sure
$ git diff --staged # old change $ git diff # new change $ git add -p # add again $ git commit -m "add a readme"
$ git merge greeting
$ git log --graph
$ git reset --hard head^
$ git reflog
$ vim hello.sh
$ git add -p
$ git commit --amend
$ git merge greeting
$ git diff --staged # clean $ git diff # dirty $ git status # summary
$ git add hello.sh
$ git commit
$ cd ..
$ git clone hello helloclone
$ cd helloclone
$ git remote -v
$ git branch -a
$ git fetch origin
$ git diff head origin/master
$ git merge origin/master
$ git push origin fix