Git host

Jeff Mitchell kde-dev at emailgoeshere.com
Wed Nov 26 01:16:58 CET 2008


Leo Franchi wrote:
> On 25 Nov 2008, at 23:00, Jeff Mitchell wrote:
>> But, I don't think is any reason that I couldn't turn the repo into  
>> one
>> that people can use to host their branches so that it's easy for
>> everyone else to check each others' branches out.  So people can git- 
>> svn
>> locally, but then push their branches up to this repo, where other
>> people could pull them down and merge if they like.
>>
>> If enough people are interested, I'll go ahead and do this -- please  
>> let
>> me know.
> 
> I'm definitely interested (provided you teach me how to make my git do  
> that....)
> 
> leo

Will do.  For anyone interested, it's not very hard at all, just takes a
few steps to get set up.  Follow the instructions and you'll be done in
no time.

The most unobvious thing is getting the .gitconfig, .curlrc, and .netrc
right.  I use CACert-signed certs, so make sure you have the following
in your .gitconfig (having it in a particular git repo's configuration
is fine too):

[user]
    name = Your Name
    email = Your at email.com
[http]
    sslVerify = false

git uses curl, so make sure you have the following in your .curlrc to
tell it to look in .netrc for username/password info and allow
self-signed certs:

netrc
insecure

In your .netrc, you need the machine, login, and password:

machine git.jefferai.com
login myusername
password mypassw0rd

Email me with your desired login/password info.  I'm not going to try to
fool around with any access control -- we're all friends here -- other
than controlling who has access to the entire repo.  So be kind to each
other.

The next step is adding the remote ref (which we will call "amarok"):

$ git remote add -f amarok https://git.jefferai.com/amarok.git
Updating amarok (bunch of output)

Now, create your branch from your git-svn (or other) starting point
("master" listed for completeness, here):

$git checkout --track -b jefferai master
Branch jefferai set up to track local branch refs/heads/master
Switched to a new branch "jefferai"

Do the initial checkin of the branch onto the server:

$ git push amarok jefferai

<output>

Now it's on the server and everyone can access it easily by fetching the
remote refs and checking out the desired branches:

$ git checkout --track -b jefferai amarok/jefferai

There's one problem though: git doesn't really understand that you want
this to be a tracking branch set up to push/pull from the remote
repository -- all it knows is that you pushed it to a place that
accepted your command.  The easiest way to go about doing this, without
futzing with a lot of arcane git config files, is simply to switch to
another branch:

$ git checkout master

delete the branch:

$ git branch -d jefferai

and re-check it out as above:

$ git checkout --track -b jefferai amarok/jefferai

You should now be able to do simple "git push" and "git pull" on the
branch to synch against the remote repository without problems.

Have fun.

(Last caveat: due to what may be a bug in git, deleting the remote
branches does not currently seem to be working.  I've done it with the
custom git protocol, but it doesn't seem happy on HTTP right now -- it
looks for the wrong ref.  I'll post instructions for that at some later
point after talking to the #git guys.)

--Jeff


More information about the Amarok-devel mailing list