Difference between revisions of "Development using git"

From Alpine Linux
Jump to: navigation, search
(svn migration to git)
(added references)
Line 1: Line 1:
[http://git.or.cz Git] is now being used for version control of the [http://dev.alpinelinux.org/cgit/cgit.cgi/alpine-baselayout/ alpine-baselayout] and [http://dev.alpinelinux.org/cgit/cgit.cgi/alpine-conf alpine-conf] packages.
+
[http://git.or.cz Git] is now being used for version control of the [http://dev.alpinelinux.org/cgit/cgit.cgi/alpine-baselayout/ alpine-baselayout] and [http://dev.alpinelinux.org/cgit/cgit.cgi/alpine-conf alpine-conf] packages.  
  
== Git Clone ==
+
== Git Clone ==
  
To get started, clone the [http://dev.alpinelinux.org/cgit git repository] for the package you are interested in:
+
To get started, clone the [http://dev.alpinelinux.org/cgit git repository] for the package you are interested in:  
  
 
   git clone git://dev.alpinelinux.org/alpine-baselayout
 
   git clone git://dev.alpinelinux.org/alpine-baselayout
 
   git clone git://dev.alpinelinux.org/alpine-conf
 
   git clone git://dev.alpinelinux.org/alpine-conf
  
Make your changes.
+
Make your changes.  
  
To prepare a patch:
+
To prepare a patch:  
  
  git diff > short-description-of-change.patch
+
  git diff > short-description-of-change.patch
  
This diff can be sent to [mailto:alpine-devel@lists.alpinelinux.org alpine-devel@lists.alpinelinux.org] mailing list.
+
This diff can be sent to [mailto:alpine-devel@lists.alpinelinux.org alpine-devel@lists.alpinelinux.org] mailing list.  
  
== Migrate a subversion repository to git ==
+
== Migrate a subversion repository to git ==
Start with creating a users.txt file where the svn users are mapped to an email address for git.
+
 
  echo "ncopa = Natanael Copa <ncopa@example.com>" > users.txt
+
Start with creating a users.txt file where the svn users are mapped to an email address for git.  
 +
 
 +
  echo "ncopa = Natanael Copa &lt;ncopa@example.com&gt;" &gt; users.txt
 +
 
 +
Create a temp work area.
  
Create a temp work area.
 
 
  mkdir proj-tmp
 
  mkdir proj-tmp
  
Init the git repository. If your svn repo does not have the standard trunk branches and tags dirs you shouldnt use the --stdlayout. You can also use -T trunk -b branches -t tags.
+
Init the git repository. If your svn repo does not have the standard trunk branches and tags dirs you shouldnt use the --stdlayout. You can also use -T trunk -b branches -t tags.  
 +
 
 
  cd proj-tmp
 
  cd proj-tmp
 
  git svn init svn://svn.alpinelinux.org/proj --stdlayout
 
  git svn init svn://svn.alpinelinux.org/proj --stdlayout
  
Connect the users.txt to the empty git repository so users are remapped.
+
Connect the users.txt to the empty git repository so users are remapped.  
 +
 
 
  git config svn.authorsfile ../users.txt
 
  git config svn.authorsfile ../users.txt
  
Fetch and import the svn repository. This might take some time.
+
Fetch and import the svn repository. This might take some time.  
 +
 
 
  git fetch
 
  git fetch
  
Now we can create a bare repository and upload it to dev.alpinelinux.org/gitroot.
+
Now we can create a bare repository and upload it to dev.alpinelinux.org/gitroot.  
 +
 
 
  cd ..
 
  cd ..
 
  git clone --bare proj-tmp proj.git
 
  git clone --bare proj-tmp proj.git
 
  scp -r proj.git dev.alpinelinux.org:/gitroot
 
  scp -r proj.git dev.alpinelinux.org:/gitroot
 +
 +
== References ==
 +
Some useful documents
 +
http://git.or.cz/course/svn.html
 +
http://book.git-scm.com/
 +
http://cworth.org/hgbook-git/tour/
 +
http://www.newartisans.com/blog/2008/04/git-from-the-bottom-up.html

Revision as of 07:35, 7 February 2009

Git is now being used for version control of the alpine-baselayout and alpine-conf packages.

Git Clone

To get started, clone the git repository for the package you are interested in:

 git clone git://dev.alpinelinux.org/alpine-baselayout
 git clone git://dev.alpinelinux.org/alpine-conf

Make your changes.

To prepare a patch:

git diff > short-description-of-change.patch

This diff can be sent to alpine-devel@lists.alpinelinux.org mailing list.

Migrate a subversion repository to git

Start with creating a users.txt file where the svn users are mapped to an email address for git.

echo "ncopa = Natanael Copa <ncopa@example.com>" > users.txt

Create a temp work area.

mkdir proj-tmp

Init the git repository. If your svn repo does not have the standard trunk branches and tags dirs you shouldnt use the --stdlayout. You can also use -T trunk -b branches -t tags.

cd proj-tmp
git svn init svn://svn.alpinelinux.org/proj --stdlayout

Connect the users.txt to the empty git repository so users are remapped.

git config svn.authorsfile ../users.txt

Fetch and import the svn repository. This might take some time.

git fetch

Now we can create a bare repository and upload it to dev.alpinelinux.org/gitroot.

cd ..
git clone --bare proj-tmp proj.git
scp -r proj.git dev.alpinelinux.org:/gitroot

References

Some useful documents http://git.or.cz/course/svn.html http://book.git-scm.com/ http://cworth.org/hgbook-git/tour/ http://www.newartisans.com/blog/2008/04/git-from-the-bottom-up.html