git short tour2009年02月08日 14時14分11秒


% cd /tmp
% mkdir gitwork
% cd gitwork
% ehco "A B C" > a.txt
% echo "1 2 3" > 1.txt
% git init
Initialized empty Git repository in /tmp/gitwork/.git/
% git add
Nothing specified, nothing added.
Maybe you wanted to say 'git add .'?
% git add .
% git ci -m '/tmp/gitwork is under git.'
git: 'ci' is not a git-command. See 'git --help'.
% git commit -m '/tmp/gitwork is under git.'
Created initial commit 997d2a4: /tmp/gitwork is under git.
 2 files changed, 2 insertions(+), 0 deletions(-)
 create mode 100644 1.txt
 create mode 100644 a.txt
% git stat a.txt
git: 'stat' is not a git-command. See 'git --help'.
% git status a.txt
# On branch master
nothing to commit (working directory clean)
% echo "10 11 12" >> 1.txt
% git diff 1.txt
diff --git a/1.txt b/1.txt
index b85905e..bb4abbd 100644
--- a/1.txt
+++ b/1.txt
@@ -1 +1,2 @@
 1 2 3
+10 11 12
% git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#
#       modified:   1.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
% git add 1.txt
% git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   1.txt
#
% git commit -m 'Added 2 digits numbers.'
Created commit 46147f6: Added 2 digits numbers.
 1 files changed, 1 insertions(+), 0 deletions(-)
% git rename a.txt A.txt
git: 'rename' is not a git-command. See 'git --help'.
% git mv a.txt A.txt
% git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       renamed:    a.txt -> A.txt
#
% git commit -m 'Uppercase.'
Created commit 3fbdfcb: Uppercase.
 1 files changed, 0 insertions(+), 0 deletions(-)
 rename a.txt => A.txt (100%)
% ls -a
.       ..      .git    1.txt   A.txt
% git log
commit 3fbdfcb2eab1accbb9d697c877b5b480e4fc964d
Author: <uyota@localhost>
Date:   Sun Feb 8 01:52:49 2009 -0500

    Uppercase.

commit 46147f6198b3f32cb04fefabc5ae98c30ec5e9b7
Author: <uyota@localhost>
Date:   Sun Feb 8 01:51:57 2009 -0500

    Added 2 digits numbers.

commit 997d2a49b3e2d891a85e22daacf594e6b4750c05
Author: <uyota@localhost>
Date:   Sun Feb 8 01:46:44 2009 -0500

    /tmp/gitwork is under git.

旅程cvsMercurial/hggitSubversion/svnrcssvk