Satellite: saving 配置服务器
[pkm.git] / pages / Git.textile
blob816f1e3cda2269224eca6eb55fb87236b31145ec
1 git-instaweb -d webrick -p 8888
3 h2. {{配置Git Reporsitory}}
5 h2. {{Hosting Git on Dreamhost}}
8 h2. workflow
10 $ git config --global user.name “Scott Chacon” 
11 $ git config --global user.email “schacon@gmail.com” chapters in this book so you can see them in 
13 h4. .gitignore
15 {{{
16 .DS_Store
17 log/*.log
18 tmp/**/*
19 tmp/*
20 config/database.yml
21 db/schema.rb
22 public/tmp*
23 #public/documents
24 #public/uploads
25 }}}
28 git show ( http://www.kernel.org/pub/software/scm/git/docs/git-show.html) 
29 git ls-tree ( http://www.kernel.org/pub/software/scm/git/docs/git-ls-tree.html) 
30 git cat-file ( http://www.kernel.org/pub/software/scm/git/docs/git-cat-fileß.html) 
31 gitk ( http://www.kernel.org/pub/software/scm/git/docs/gitk.html) 
32 git instaweb ( http://www.kernel.org/pub/software/scm/git/docs/git-instaweb.html) 
36 Normally I will just use 
37   *‘git stash’* 
38 to save 
39 something, go work elsewhere, then come back and run 
40   *‘git stash apply’* 
41 to get back to where I was
45 $ git-archive --prefix=simplegit/ v0.1 | gzip > simple-git-0.1.tgz
48 $ git-archive --format=zip master^ lib/ > simple-git-lib.zip  #partial
52 h2. git分支操作
53 {{{
54 HoLin:tmp holin$ mkdir merge_test
55 HoLin:tmp holin$ cd merge_test/
56 HoLin:merge_test holin$ git init
57 Initialized empty Git repository in .git/
58 HoLin:merge_test holin$ touch 1.txt
59 HoLin:merge_test holin$ git add .; git commit
60 Created initial commit efd7ca6: i
61  0 files changed, 0 insertions(+), 0 deletions(-)
62  create mode 100644 1.txt
63 HoLin:merge_test holin$ git branch b1
64 HoLin:merge_test holin$ git checkout b1
65 Switched to branch "b1"
66 HoLin:merge_test holin$ touch 2.txt
67 HoLin:merge_test holin$ git add .; git commit
68 Created commit 9845e18: 2
69  0 files changed, 0 insertions(+), 0 deletions(-)
70  create mode 100644 2.txt
71 HoLin:merge_test holin$ git checkout master
72 Switched to branch "master"
73 HoLin:merge_test holin$ git merge b1
74 Updating efd7ca6..9845e18
75 Fast forward
76  0 files changed, 0 insertions(+), 0 deletions(-)
77  create mode 100644 2.txt
78 HoLin:merge_test holin$ 
79 }}}
82 当前分支,执行 git merge  branch1, 合并branch1的改变到当前分支。