Skip to content

Latest commit

 

History

History
58 lines (50 loc) · 1.06 KB

demo-commands.wiki

File metadata and controls

58 lines (50 loc) · 1.06 KB

Table of Contents

Drupal Camp 11 Talk Demos

Demo 1

part 1

ls git init git add -A git commit git log

part 2

  1. create another file
echo 'hello' > anotherfile.txt
  1. modify 2 files
vim say-hi.rb vim hello.txt git status git diff git add say-hi.rb
  1. show the different state
git status
  1. commit the new file but not the modified file
git commit
  1. show this
git status

  1. show how to avoid the index
git commit -a

  1. show the patch option (first modify the file on two blocks)
vim hello.txt git add -p hello.txt ? # show the options s # split the chunks y # add the chunk n # ignore the chunk git status git commit git status
  1. show that line 2 has not been committed
git diff

  1. now show the diff between indexed and not
git add git diff # shows nothing because added to index git diff --cached # shows the changes
  1. modify the file again to have it twice in the status
vim hello.txt git status # file is twice in status

git commit git status # file is still modified

  1. restore modified file to the commited one
git checkout -- hello.txt git status vim hello.txt # show the file