Diff for /wikisrc/tutorials/using_git_to_track_netbsd_cvs_source_repository.mdwn between versions 1.1 and 1.2

version 1.1, 2011/11/25 00:19:18 version 1.2, 2012/02/05 07:14:36
Line 1 Line 1
 **Contents**  **Contents**
   
 [[!toc levels=3]]  [[!toc levels=3]]
   
 #  Introduction  #  Introduction
   
 The purpose of this document is to guide you on how to track NetBSD CVS source repository with [git][12]. We are going to make a "bulk import" and by this is meant that not all the CVS checkins with comments are going to be imported. If we wanted so, we would use the [git-cvsimport(1)][13] tool.  The purpose of this document is to guide you on how to track NetBSD CVS source repository with [git][12]. We are going to make a "bulk import" and by this is meant that not all the CVS checkins with comments are going to be imported. If we wanted so, we would use the [git-cvsimport(1)][13] tool. 
   
    [12]: http://git.or.cz/ (http://git.or.cz/)     [12]: http://git.or.cz/ (http://git.or.cz/)
    [13]: http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html (http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html)     [13]: http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html (http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html)
   
 #  Download current source  #  Download current source
   
 To begin with, we must have a current CVS snapshot of the NetBSD source tree. I assume you already have one in `/usr/src-git`. If not, please consult [this article][14] in the official NetBSD documentation page.  To begin with, we must have a current CVS snapshot of the NetBSD source tree. I assume you already have one in `/usr/src-git`. If not, please consult [this article][14] in the official NetBSD documentation page. 
   
    [14]: http://www.netbsd.org/docs/current/#downloading (http://www.netbsd.org/docs/current/#downloading)     [14]: http://www.netbsd.org/docs/current/#downloading (http://www.netbsd.org/docs/current/#downloading)
   
 #  Symbiosis  #  Symbiosis
   
 Since both CVS and Git are going to live together inside the same directory, it is essential to hide each one from the other. That is because we don't want CVS to track git files or vice versa. For this purpose we need two files inside the root directory of our source tree.  Since both CVS and Git are going to live together inside the same directory, it is essential to hide each one from the other. That is because we don't want CVS to track git files or vice versa. For this purpose we need two files inside the root directory of our source tree. 
   
 ##  .cvsignore  ##  .cvsignore
   
 Create a file named `.cvsignore` inside `/usr/src-git` and put the following line in it:  Create a file named `.cvsignore` inside `/usr/src-git` and put the following line in it: 
          
     .git/      .git/
     .gitignore      .gitignore
          
   
 ##  .gitignore  ##  .gitignore
   
 Create a file named `.gitignore` inside `/usr/src-git` and put the following lines in it:  Create a file named `.gitignore` inside `/usr/src-git` and put the following lines in it: 
          
     CVS/      CVS/
     .cvsignore      .cvsignore
          
   
 #  Initial import of NetBSD CVS source repository  #  Initial import of NetBSD CVS source repository
          
     # cd /usr/src-git      # cd /usr/src-git
     # git init      # git init
     Initialized empty Git repository in /usr/src-git/.git/      Initialized empty Git repository in /usr/src-git/.git/
     # git add .      # git add .
     # git commit -m "Initial import of the NetBSD CVS source repository"      # git commit -m "Initial import of the NetBSD CVS source repository"
          
   
 #  Keeping the git repository uptodate with CVS  #  Keeping the git repository uptodate with CVS
   
 From time to time, we update the main git repository with the latest changes from CVS.  From time to time, we update the main git repository with the latest changes from CVS. 
          
     # cvs update -dPA      # cvs update -dPA
     # git add .      # git add .
     # git commit -a -m "Update to latest CVS snapshot"      # git commit -a -m "Update to latest CVS snapshot"
          
   
 #  Done  #  Done
   
 You can examine the log:  You can examine the log: 
          
     # cd /usr/src-git      # cd /usr/src-git
     # git log      # git log
     commit 9fe7a0469a8ef58fd5b484c0931808a2d23f559e      commit 9fe7a0469a8ef58fd5b484c0931808a2d23f559e
     Author: Charlie <root@netbsd.(none)>      Author: Charlie <root@netbsd.(none)>
     Date:   Mon Nov 24 01:17:31 2008 +0200      Date:   Mon Nov 24 01:17:31 2008 +0200
          
         Update to latest CVS snapshot          Update to latest CVS snapshot
          
     commit 78189d3fa331073021eaea88d1f51f3487d756b7      commit 78189d3fa331073021eaea88d1f51f3487d756b7
     Author: Charlie <root@netbsd.(none)>      Author: Charlie <root@netbsd.(none)>
     Date:   Mon Nov 24 00:59:47 2008 +0200      Date:   Mon Nov 24 00:59:47 2008 +0200
          
         Initial import of the NetBSD CVS source repository          Initial import of the NetBSD CVS source repository
     #      #
          
   
 Or create a crazy branch to work on, offline, without being embarassed if it ends up as a dead end.  Or create a crazy branch to work on, offline, without being embarassed if it ends up as a dead end. 
          
     # cd /usr/src-git      # cd /usr/src-git
     # git branch      # git branch
     * master      * master
     # git checkout -b crazy-branch      # git checkout -b crazy-branch
     Switched to a new branch "crazy-branch"      Switched to a new branch "crazy-branch"
     # git branch -a      # git branch -a
     * crazy-branch      * crazy-branch
       master        master
     #      #
          
   
 #  References  #  References
   
 [Using git to track firefox cvs][15]  [Using git to track firefox cvs][15]
   
    [15]: http://www.bluishcoder.co.nz/2007/06/using-git-to-track-firefox-cvs.html (http://www.bluishcoder.co.nz/2007/06/using-git-to-track-firefox-cvs.html)     [15]: http://www.bluishcoder.co.nz/2007/06/using-git-to-track-firefox-cvs.html (http://www.bluishcoder.co.nz/2007/06/using-git-to-track-firefox-cvs.html)
   

Removed from v.1.1  
changed lines
  Added in v.1.2


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb