File:  [NetBSD Developer Wiki] / wikisrc / tutorials / using_git_to_track_netbsd_cvs_source_repository.mdwn
Revision 1.4: download - view: text, annotated - select for diffs
Sun Dec 29 23:48:32 2013 UTC (7 years, 1 month ago) by jakllsch
Branches: MAIN
CVS tags: HEAD
Dead link, but the WaybackMachine has it.


[[!toc levels=3]]

#  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. 

   [12]: (
   [13]: (

#  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. 

   [14]: (

#  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. 

##  .cvsignore

Create a file named `.cvsignore` inside `/usr/src-git` and put the following lines in it: 

##  .gitignore

Create a file named `.gitignore` inside `/usr/src-git` and put the following lines in it: 

#  Initial import of NetBSD CVS source repository
    # cd /usr/src-git
    # git init
    Initialized empty Git repository in /usr/src-git/.git/
    # git add .
    # git commit -m "Initial import of the NetBSD CVS source repository"

#  Keeping the git repository uptodate with CVS

From time to time, we update the main git repository with the latest changes from CVS. 
    # cvs update -dPA
    # git add .
    # git commit -a -m "Update to latest CVS snapshot"

#  Done

You can examine the log: 
    # cd /usr/src-git
    # git log
    commit 9fe7a0469a8ef58fd5b484c0931808a2d23f559e
    Author: Charlie <root@netbsd.(none)>
    Date:   Mon Nov 24 01:17:31 2008 +0200
        Update to latest CVS snapshot
    commit 78189d3fa331073021eaea88d1f51f3487d756b7
    Author: Charlie <root@netbsd.(none)>
    Date:   Mon Nov 24 00:59:47 2008 +0200
        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. 
    # cd /usr/src-git
    # git branch
    * master
    # git checkout -b crazy-branch
    Switched to a new branch "crazy-branch"
    # git branch -a
    * crazy-branch

#  References

[Using git to track firefox cvs][15]

   [15]: (

CVSweb for NetBSD wikisrc <> software: FreeBSD-CVSweb