Since there seems to be no winner in the RCS discussion, we have basically two
choices: 1. stay with SVN, 2. Decide on one of them (as backend at least). From
what I've read, it seems it is easily possible to access a git repository with
both hg and bzr. So I've set up a git repo for testing.

The Repository
--------------

The repo can be accessed at
git://warzone2100.git.sourceforge.net/gitroot/warzone2100/test (read-only) and
ssh://usern...@warzone2100.git.sourceforge.net/gitroot/warzone2100/test (commit
access for all SF project members). It was made by importing
trunk/tools/editworld into git-svn and is ~ 2 MB currently. The content was
chosen somewhat randomly, it is not meant to be useful (as you might note when
looking at some of the recent commits), feel free to do (almost) anything to
it (except maybe png crushing, so the size stays small for testing).

git
---

For direct access with git, you obviously need that installed (version 1.6+ I
think). Cloning is done with "git clone <url> [folder]", this will check out
the data into "folder" (or the repo name "test" if you don't specify it). Then
you do local changes, commit with "git commit -a" for all changes (check with
"git diff"), or specify file names instead of "-a". Pushing back to Sourceforge
is done with "git push".

To create a new branch from the currently checked out revision, do "git
checkout -b <branchname>" (or "git branch <branchname>; git checkout
<branchname>"). This new branch will be in your local repo only, to push it to
SF do "git push origin <branchname>" ("origin" is a shortcut for the repo you
cloned from, you can also specify another repo there).

SSH keys
--------

You can create an ssh key so you don't always have to input your password for
pushes etc., see
https://sourceforge.net/apps/trac/sourceforge/wiki/SSH%20keys#KeyGeneration:OpenSSH.
If you already have a key in .ssh, save it to a different file and add that
with ssh-add. Then upload the public key (in <filename_.pub) to
https://sourceforge.net/account/ssh (make sure it stays as one line!).

Mercurial on Linux
------------------

Install the hg-git extension and activate it. On Debian, that can be done with
"apt-get install mercurial-git", and then adding the following to ~/.hgrc:

[extensions]
hgext.bookmarks =
hgext.git =

Then you can "hg clone" the git url, for ssh you need to use "git+ssh://" as
protocol. Pushing seems a bit slow, though.

TortoiseHG on Windows
---------------------

Download from http://tortoisehg.bitbucket.org/, install with the default
options. Then right-click the desktop, choose TortoiseHG->Clone..., enter
"http://bitbucket.org/durin42/hg-git"; as source and "C:\hg-git" (or where you
want it, just adjust the path below then) as destination.  This will download
the hg-git plugin you need to access git repositories from hg. Then go to
Program Files\TortoiseHG and make a new file "Mercurial.ini" with the following
three lines:

[extensions]
bookmarks =
hggit = C:\hg-git\hggit

This works for the git:// url, git+ssh:// needs some more setup. First, go to
Program Files\TortoiseHg and copy TortoisePlink.exe to ssh.exe. Then download
http://the.earth.li/~sgtatham/putty/latest/x86/puttygen.exe, feed your private
SSH key into it (see above) and save it in ppk format. Start Pageant.exe from
the TortoiseHg folder and import the converted ppk key.

After that, cloning works, but pushing/pulling still fails... Could be that I
screwed something up while experimenting.

Well, that's enough for now. Feel free to experiment with the repo, and report
anything regarding needed setup etc., also the bzr part is still untested.

_______________________________________________
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev

Reply via email to