ctdo/Vorträge/git/first_steps/4_demo.md

3.5 KiB

!SLIDE commandline incremental

$ git init ctdo-projekt
Initialized empty Git repository in ~/ctdo-projekt/.git/
$ cd ctdo-projekt

!SLIDE commandline incremental

$ echo "Hello world" > README
$ git status
 # On branch master
 #
 # Initial commit
 #
 # Untracked files:
 #   (use "git add <file>..." to include in what will
 #   be committed)
 #
 # README
 nothing added to commit but untracked files present
 (use "git add" to track)

!SLIDE commandline

$ echo "Hello world" > README
$ git status
 # On branch master
 #
 # Initial commit
 #
# Untracked files:_
 #   (use "git add <file>..." to include in what will
 #   be committed)
 #
# README_
 nothing added to commit but untracked files present
 (use "git add" to track)

!SLIDE commandline incremental

$ git add README
$ git status
 # On branch master
 #
 # Initial commit
 #
 # Changes to be committed:
 #   (use "git rm --cached <file>..." to unstage)
 #
 # new file:   README
 #

!SLIDE commandline

$ git add README
$ git status
 # On branch master
 #
 # Initial commit
 #
 # Changes to be committed:
 #   (use "git rm --cached <file>..." to unstage)
 #
# new file:   README_
 #

!SLIDE commandline incremental

$ git commit -m 'init'
[master (root-commit) 794d395] init
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 README
$ git status
 # On branch master
nothing to commit (working directory clean)

!SLIDE commandline incremental

$ git log
commit 794d3953e63b0b0e661206479ae70bc5f21d553c
Author: Jan-Erik Rediger <badboy@ctdo.de>
Date:   Mon Mar 05 01:20:55 2012 +0200

    init

!SLIDE commandline incremental

$ echo "© ctdo" >> README
$ git status
 # On branch master
 # Changes not staged for commit:
 #   (use "git add <file>..." to update what will
 #    be committed)
 #   (use "git checkout -- <file>..." to discard changes
 #   in working directory)
 #
 # modified:   README
 #
no changes added to commit (use "git add" and/or
"git commit -a")

!SLIDE commandline

$ echo "© ctdo" >> README
$ git status
 # On branch master
 # Changes not staged for commit:
 #   (use "git add <file>..." to update what will
 #    be committed)
 #   (use "git checkout -- <file>..." to discard changes
 #   in working directory)
 #
# modified:   README_
 #
no changes added to commit (use "git add" and/or
"git commit -a")

!SLIDE commandline incremental

$ git add README
$ git diff --cached
diff --git c/README w/README
index d00491f..446a974 100644
--- c/README
+++ w/README
@@ -1 +1,2 @@
 Hello world
+© ctdo

!SLIDE commandline incremental

$ git commit -m 'added info'
[master bdc13db] added info
 1 files changed, 1 insertions(+), 0 deletions(-)

!SLIDE commandline incremental

$ git log
commit bdc13dbd21b5f9c91e7d678bfc57eea1714c5482
Author: Jan-Erik Rediger <badboy@ctdo.de>
Date:   Mon Mar 05 01:32:37 2012 +0200

    added info

commit 794d3953e63b0b0e661206479ae70bc5f21d553c
Author: Jan-Erik Rediger <badboy@ctdo.de>
Date:   Mon Mar 05 01:20:55 2012 +0200

    init

!SLIDE commandline incremental

$ git diff HEAD^
diff --git c/README w/README
index d00491f..446a974 100644
--- c/README
+++ w/README
@@ -1 +1,2 @@
 Hello world
+© ctdo