-->
./
<!-- フラ&#65533;ュが見れな&#65533;のためにここに何か書&#65533; --> フラ&#65533;ュがインス&#65533;&#65533;ルされて&#65533;&#65533;たいで&#65533;&#65533;&#65533;

2010年01月11日

git(ソースコードの分散型バージョン管理システム)

参考:http://apple-tart.net/dokuwiki/doku.php?id=development_tool:vc:git
   http://ja.wikipedia.org/wiki/Git

 どうもgitでは、CVSやSubversionのようにチェックアウトとという概念自体がないみたいです。cloneというコマンドがそれに相当するみたいですが、複製という意味合いが強い感じです。ローカル側からサーバのgitコマンドを操作するみたいで、git-upload-packなどというコマンドにパスが通っている必要があるみたいですが、サーバ側の.bashrcなどの設定ファイルは読み込まないので、whichでコマンドにパスが通っていてもエラーが起こる場合があるみたいです。さくらインターネットでは、インストール先の/home/ユーザ名/local/binからgitのコマンド一式を、/home/ユーザ名/binにシンボリックリンクを張ることで対処出来ました。
 覚え書きの具体例ですが、主要なコマンドだけ、色づけをしておきます。はっきりしたことは確認していませんが、 サーバではgit-test.gitのディレクトリを丸ごと消せば、何もなかった状態に戻せるのだと思います。cloneの作業ファイルは、そのまま別のリポジトリでも使えそうです。

サーバ側
[sakura git] % mkdir git-test.git
[sakura git] % cd git-test.git/
[sakura git-test.git] % ls
[sakura git-test.git] % git --bare init
Initialized empty Git repository in /home/hirono-hideki-01/git/git-test.git/
[sakura git-test.git] % ls
HEAD        config      hooks       objects
branches    description info        refs
[sakura git-test.git] %

ローカル側
u9@u9-vmx:~/tmp % mkdir project
u9@u9-vmx:~/tmp % cd project/ 
u9@u9-vmx:~/tmp/project % ls  
u9@u9-vmx:~/tmp/project % rails pj0001
      create                         
      create  app/controllers        
      create  app/helpers            
      create  app/models             
      create  app/views/layouts      
      create  config/environments    
      create  config/initializers    
      create  config/locales         
      create  db                     
      create  doc                    
      create  lib                    
      create  lib/tasks              
      create  log                    
      create  public/images          
      create  public/javascripts     
      create  public/stylesheets     
      create  script/performance     
      create  test/fixtures          
      create  test/functional        
      create  test/integration       
      create  test/performance       
      create  test/unit              
      create  vendor                 
      create  vendor/plugins         
      create  tmp/sessions           
      create  tmp/sockets            
      create  tmp/cache              
      create  tmp/pids               
      create  Rakefile               
      create  README                 
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb       
      create  config/database.yml                     
      create  config/routes.rb                        
      create  config/locales/en.yml                   
      create  db/seeds.rb                             
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/inflections.rb       
      create  config/initializers/mime_types.rb        
      create  config/initializers/new_rails_defaults.rb
      create  config/initializers/session_store.rb     
      create  config/environment.rb                    
      create  config/boot.rb                           
      create  config/environments/production.rb        
      create  config/environments/development.rb       
      create  config/environments/test.rb              
      create  script/about                             
      create  script/console                           
      create  script/dbconsole                         
      create  script/destroy                           
      create  script/generate                          
      create  script/runner                            
      create  script/server                            
      create  script/plugin                            
      create  script/performance/benchmarker           
      create  script/performance/profiler              
      create  test/test_helper.rb                      
      create  test/performance/browsing_test.rb        
      create  public/404.html                          
      create  public/422.html                          
      create  public/500.html                          
      create  public/index.html                        
      create  public/favicon.ico                       
      create  public/robots.txt                        
      create  public/images/rails.png                  
      create  public/javascripts/prototype.js          
      create  public/javascripts/effects.js            
      create  public/javascripts/dragdrop.js           
      create  public/javascripts/controls.js           
      create  public/javascripts/application.js        
      create  doc/README_FOR_APP                       
      create  log/server.log                           
      create  log/production.log                       
      create  log/development.log                      
      create  log/test.log                             
u9@u9-vmx:~/tmp/project % git init                     
Initialized empty Git repository in /home/u9/tmp/project/.git/
u9@u9-vmx:~/tmp/project % git add .                          
u9@u9-vmx:~/tmp/project % git commit -m "initial commit"     
[master (root-commit) 82f37ce] initial commit                
 42 files changed, 8461 insertions(+), 0 deletions(-)        
 create mode 100644 pj0001/README                            
 create mode 100644 pj0001/Rakefile                          
 create mode 100644 pj0001/app/controllers/application_controller.rb
 create mode 100644 pj0001/app/helpers/application_helper.rb       
 create mode 100644 pj0001/config/boot.rb                          
 create mode 100644 pj0001/config/database.yml                     
 create mode 100644 pj0001/config/environment.rb                   
 create mode 100644 pj0001/config/environments/development.rb      
 create mode 100644 pj0001/config/environments/production.rb       
 create mode 100644 pj0001/config/environments/test.rb             
 create mode 100644 pj0001/config/initializers/backtrace_silencers.rb
 create mode 100644 pj0001/config/initializers/inflections.rb       
 create mode 100644 pj0001/config/initializers/mime_types.rb        
 create mode 100644 pj0001/config/initializers/new_rails_defaults.rb
 create mode 100644 pj0001/config/initializers/session_store.rb     
 create mode 100644 pj0001/config/locales/en.yml                    
 create mode 100644 pj0001/config/routes.rb                         
 create mode 100644 pj0001/db/seeds.rb                              
 create mode 100644 pj0001/doc/README_FOR_APP                       
 create mode 100644 pj0001/log/development.log                      
 create mode 100644 pj0001/log/production.log                       
 create mode 100644 pj0001/log/server.log                           
 create mode 100644 pj0001/log/test.log                             
 create mode 100644 pj0001/public/404.html                          
 create mode 100644 pj0001/public/422.html                          
 create mode 100644 pj0001/public/500.html                          
 create mode 100644 pj0001/public/favicon.ico                       
 create mode 100644 pj0001/public/images/rails.png                  
 create mode 100644 pj0001/public/index.html                        
 create mode 100644 pj0001/public/javascripts/application.js        
 create mode 100644 pj0001/public/javascripts/controls.js           
 create mode 100644 pj0001/public/javascripts/dragdrop.js           
 create mode 100644 pj0001/public/javascripts/effects.js            
 create mode 100644 pj0001/public/javascripts/prototype.js          
 create mode 100644 pj0001/public/robots.txt                        
 create mode 100755 pj0001/script/about                             
 create mode 100755 pj0001/script/console                           
 create mode 100755 pj0001/script/dbconsole                         
 create mode 100755 pj0001/script/destroy                           
 create mode 100755 pj0001/script/generate                          
 create mode 100755 pj0001/script/performance/benchmarker           
 create mode 100755 pj0001/script/performance/profiler              
 create mode 100755 pj0001/script/plugin                            
 create mode 100755 pj0001/script/runner                            
 create mode 100755 pj0001/script/server                            
 create mode 100644 pj0001/test/performance/browsing_test.rb        
 create mode 100644 pj0001/test/test_helper.rb                      
u9@u9-vmx:~/tmp/project % git remote add origin ssh://hirono-hideki-01@hirono-hideki-01.sakura.ne.jp/home/hirono-hideki-01/git/git-test.git                                        
u9@u9-vmx:~/tmp/project % git push origin master
Counting objects: 63, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (55/55), done.
Writing objects: 100% (63/63), 79.40 KiB, done.
Total 63 (delta 10), reused 0 (delta 0)
To ssh://hirono-hideki-01@hirono-hideki-01.sakura.ne.jp/home/hirono-hideki-01/git/git-test.git
 * [new branch]      master -> master
u9@u9-vmx:~/tmp/project % mkdir ../git-test-work
u9@u9-vmx:~/tmp/project % cd ../git-test-work/
u9@u9-vmx:~/tmp/git-test-work % ls
u9@u9-vmx:~/tmp/git-test-work % git clone ssh://hirono-hideki-01@hirono-hideki-01.sakura.ne.jp/home/hirono-hideki-01/git/git-test.git
Initialized empty Git repository in /home/u9/tmp/git-test-work/git-test/.git/
remote: Counting objects: 63, done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 63 (delta 10), reused 0 (delta 0)
Receiving objects: 100% (63/63), 79.23 KiB, done.
Resolving deltas: 100% (10/10), done.
u9@u9-vmx:~/tmp/git-test-work % ls
git-test
u9@u9-vmx:~/tmp/git-test-work % ls git-test/
pj0001
u9@u9-vmx:~/tmp/git-test-work % ls git-test/pj0001/
README  Rakefile  app  config  db  doc  log  public  script  test
u9@u9-vmx:~/tmp/git-test-work %


Powered by ScribeFire.

posted by hirono at 09:16| Comment(0) | TrackBack(0) | ソフト
この記事へのコメント
コメントを書く
お名前:

メールアドレス:

ホームページアドレス:

コメント:

この記事へのトラックバックURL
http://blog.sakura.ne.jp/tb/34674624

この記事へのトラックバック