wiki:TipAndDoc/scm/git

Version 17 (modified by mitty, 12 years ago) (diff)

--

Git

git-svn

convert svn repos to git

  • trunk/tags/branches -> -s オプションで拾える
  • vendor -> 手動でconfig --addしてfetch
  • リモートブランチをローカルブランチへ変更する
  1. mitty@test:~/works$ git svn init -s http://lab.mitty.jp/svn/lab/ lab
    Initialized empty Git repository in /home/mitty/works/lab/.git/
    
  2. mitty@test:~/works/lab (master)$ cat .git/config
    [core]
    	repositoryformatversion = 0
    	filemode = true
    	bare = false
    	logallrefupdates = true
    [svn-remote "svn"]
    	url = http://lab.mitty.jp/svn/lab
    	fetch = trunk:refs/remotes/trunk
    	branches = branches/*:refs/remotes/*
    	tags = tags/*:refs/remotes/tags/*
    
  3. mitty@test:~/works/lab (master)$ git config --add svn-remote.svn.fetch "vendor:refs/remotes/vendor"
    [core]
    	repositoryformatversion = 0
    	filemode = true
    	bare = false
    	logallrefupdates = true
    [svn-remote "svn"]
    	url = http://lab.mitty.jp/svn/lab
    	fetch = trunk:refs/remotes/trunk
    	branches = branches/*:refs/remotes/*
    	tags = tags/*:refs/remotes/tags/*
    	fetch = vendor:refs/remotes/vendor
    
  4. mitty@test:~/works/lab (master)$ git svn fetch
    Checked out HEAD:
      http://lab.mitty.jp/svn/lab/trunk r204
    creating empty directory: TipAndDoc/tools/trac/plugins
    
    • mitty@test:~/works/lab (master)$ ls -1F
      Commentary/
      Dev/
      misc/
      TipAndDoc/
      
    • mitty@test:~/works/lab (master)$ git tag -l
    • mitty@test:~/works/lab (master)$ git br -a
      * master
        remotes/tags/r89-trunk
        remotes/tags/snuploader_name
        remotes/tags/snuploader_name@29
        remotes/tags/snuploader_name@36
        remotes/tags/twitter
        remotes/trunk
        remotes/twitter-0.1
        remotes/twitter-0.1@44
        remotes/twitter-0.1@65
        remotes/twitter-0.1@66
        remotes/vendor
      
  5. mitty@test:~/works/lab (master)$ mv .git/refs/remotes/tags/* .git/refs/tags/
  6. mitty@test:~/works/lab (master)$ rmdir .git/refs/remotes/tags/
  7. mitty@test:~/works/lab (master)$ mv .git/refs/remotes/* .git/refs/heads/
  8. mitty@test:~/works/lab (master)$ rmdir .git/refs/remotes/
  • mitty@test:~/works/lab (master)$ git tag -l
    r89-trunk
    snuploader_name
    snuploader_name@29
    snuploader_name@36
    twitter
    
  • mitty@test:~/works/lab (master)$ git br -a
    * master
      trunk
      twitter-0.1
      twitter-0.1@44
      twitter-0.1@65
      twitter-0.1@66
      vendor
    
    • mitty@test:~/works/lab (master)$ git co vendor
      Switched to branch 'vendor'
      
    • mitty@test:~/works/lab (vendor)$ ls -1F
      DrRacket/
      GeSHi-1.0.8.9/
      lxc/
      OCaml/
      SnUploader/
      TipAndDoc/
      trac/
      twitter/
      ubuntu/
      utvpn/
      vmware/
      

git-http-backend

  • Ubuntu 12.04では、fcgiwrapパッケージを導入すると/var/run/fcgiwrap.socketが自動的に作成される

prompt

  • bash

github

gitweb