savannah-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Savannah-cvs] [UsingGit] Move user instructions from Git


From: Beuc
Subject: [Savannah-cvs] [UsingGit] Move user instructions from Git
Date: Tue, 26 Jun 2007 22:07:33 +0000

Web browser: http://cvs.sv.gnu.org/gitweb/

Setup
=====

Your identify for when you push commits (strongly recommended)::

 git config --global user.name "Your Name Comes Here"
 git config --global user.email address@hidden

Enable colors (optional)::

 git config --global color.diff auto
 git config --global color.status auto
 git config --global color.branch auto


Basic commands
==============

* Checkout::

   git clone git://git.sv.gnu.org/project.git

* Firewall checkout: if you're behing a outgoing-traffic-filtering firewall, 
you can use Git's "dumb protocol" via HTTP
  - note that this is SLOWER,
  both for you and Savannah. Avoid if possible, and please tell your local 
sysadmin to allow outgoing git traffic (port 9418)::

   git clone http://git.sv.gnu.org/r/project.git

* Developer checkout via SSH::

   git clone git+ssh://address@hidden/srv/git/project.git

* Commit::

   git-update-index README
   git commit
   git push git+ssh://address@hidden/srv/git/project.git

* Initial push::

   mkdir test
   cd test
   git init-db
   touch README
   git add README
   git commit
    
   git push address@hidden:/srv/git/project.git master:refs/heads/master


CVS import
==========

Werner Lemberg imported project 'cjk' from CVS,
using Keith Packard's parsecvs program, which "worked just fine":

* Get the source of parsecvs::

   git clone git://people.freedesktop.org/~keithp/parsecvs

* Download the tarball of git itself, uncompress it, and say 'make'
  to build 'libgit.a'.

* Copy 'libgit.a' into the 'parsecvs' directory.

* Edit the Makefile of 'parsecvs' to say::

   GITPATH=.

* Say 'make' and 'make install' to compile and install parsecvs in '~/bin'.

* Grab your CVS tree (with the 'foo,v' files)::

   rsync rsync://cvs.sv.gnu.org/sources/myproject/ myproject/

* Now change to your CVS tree (with the 'foo,v' files) and
  build a '.git' directory within the current directory::

   find -name '*,v' | parsecvs

* Say 'git clone mydestdir' to check out all files in 'mydestdir/' and
  to pack the git objects.  The current '.git' directory can be
  deleted now.

* Finally, change to 'mydestdir/' and publish the repository at Savannah::

   git push address@hidden:/srv/git/myproject.git master:refs/heads/master

Other programs include 'git-cvsimport', provided along with git.
Han-Wen Nienhuys suggested using an authors file via the '-A' option,
so that git uses a realname instead of a username for the committer.


SVN import
==========

Git comes with 2 SVN-related tools: git-svnimport and git-svn. git-svnimport is 
for importing revisions (a one-shot import, or incrementally); git-svn is a 
2-way gateway to a SVN repository, similar to SVK, more useful for maintaining 
a local branch than for importing a repository (IMHO). We'll use git-svnimport.

Those tools use an authors file to map username->real name (option -A)
it looks like this::

 rms = Richard M. Stallman <address@hidden>
 toto = Another User <address@hidden>
 ...

Common invokation::

 git-svnimport -v -I .gitignore -A ../authors.txt file:///home/me/svn_repo

To ignore branches::

 git-svnimport -v -I .gitignore -A ../authors.txt -b idontexist 
file:///home/me/svn_repo

git-svnimport assumes there's a trunk, a branches, and a tags directory (names 
are configurable) and ignores other directories. You may run into troubles if 
your layout changed during your former SVN life.

You'll usually perform the import several times before getting what you want.
For this reason it's preferable to rsync the SVN repository locally, or create 
it from a dump::

 rsync -av rsync://svn.sv.gnu.org::svn/myproject svn_repo
  
 wget http://svn.gna.org/daily/myproject.dump.gz
 svnadmin init svn_repo
 zcat myproject.dump.gz | svnadmin load svn_repo/

Links
=====

* CVS import issues: http://www.spinics.net/lists/git/msg05266.html

* repo.or.cz: hosting system similar to Savannah. Offers a public ''mob'' 
branch. The internals look a bit ad-hoc (lots of cron jobs that changes all 
permissions, privileges to Apache instead of a cron'd backend).

* http://git.or.cz/course/ - "switching to git" crash course (from CVS, Git, 
and also Quilt->StGit)

* http://www.kernel.org/pub/software/scm/git/docs/tutorial.html - Tutorial

* http://www.kernel.org/pub/software/scm/git/docs/everyday.html - Everyday GIT 
With 20 Commands Or So

--
forwarded from 
https://savannah.gnu.org/maintenance/address@hidden://savannah.gnu.org/maintenance




reply via email to

[Prev in Thread] Current Thread [Next in Thread]