[TYPO3-core] How to set up Git GUI client with SSH-RSA key on Windows

Stephan Schuler Stephan.Schuler at netlogix.de
Mon Jun 6 09:34:23 CEST 2011

Hey all.

Needing the " git push origin HEAD:refs/for/<release-branch>/<topic>" is only half the truth.
It is true that you need it, but you don't have to type it over and over.

Just have a look at "git help remote", I guess it's all there.

There are some commands to configure it, but I don't know them by heart. But you can edit your ".git/config" file as well.
It could look like this:
> [remote "origin"]
>         url = git://git.typo3.org/FLOW3/Packages/FLOW3.git
>         fetch = +refs/heads/*:refs/remotes/upstream/*
>         push = HEAD:refs/for/master
>         pushurl = ssh://<yourname>@review.typo3.org:29418/FLOW3/Packages/FLOW3
> [branch "master"]
>         remote = origin
>         merge = refs/heads/master

As you can see, there's a place for the "HEADS:refs/for/master" part in the "remote" block.
If you have set up your git config this way, you can only use "git push".


Stephan Schuler

Telefon: +49 (911) 539909 - 0
E-Mail: Stephan.Schuler at netlogix.de
Website: media.netlogix.de

netlogix GmbH & Co. KG
IT-Services | IT-Training | Media
Andernacher Straße 53 | 90411 Nürnberg
Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
E-Mail: info at netlogix.de | Internet: http://www.netlogix.de

netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
Umsatzsteuer-Identifikationsnummer: DE 233472254
Geschäftsführer: Stefan Buchta, Matthias Schmidt

-----Ursprüngliche Nachricht-----
Von: typo3-team-core-bounces at lists.typo3.org [mailto:typo3-team-core-bounces at lists.typo3.org] Im Auftrag von Steffen Gebert
Gesendet: Sonntag, 5. Juni 2011 21:03
An: typo3-team-core at lists.typo3.org
Betreff: Re: [TYPO3-core] How to set up Git GUI client with SSH-RSA key on Windows

> I'm still confused about this line:
> git push origin HEAD:refs/for/<release-branch>/<topic>
> Why can't I just use something like this:
> git push origin master

Easy answer. Just accept it. It has to be this way with Gerrit :) Long answer: `git push` or `git push origin master` would push your changes to the master branch on the remote. However, this is what Gerrit
prohibits: As it's a kind of "gatekeeper" in front of the Git repository, you're not allowed to do so. Instead, Gerrit uses refs/for/ as starting point to create a new Change Request.

> Any why do I need the "HEAD:" part?
That's the way it is. Ask Linus, why he decided to build git this way.
HEAD is the reference to the commit, at which your working tree currently is. The command says to push the whole series of commits (from the first one till HEAD). You can also use references to a branch (I
think) or the SHA of a commit (I know), which you want to push.

> What exactly is the refs directory for?
master is the same as refs/heads/master/ (have a look in your .git/refs/heads/ directory): The heads are the references to all the branch entry points (they point to the most recent commit of the branch). So another (even longer) version of the not working `git push` is `git push origin HEAD:refs/heads/master`

So refs/ is a standard git thingy. The refs/for/ is coming from Gerrit.

> Is it comparable to tagging in subversion?
Somehow. refs contains references (ha ;-)) of branches, tags and remotes to the commit, to which they are pointing to.

> (So I'm also a total newbee in SVN too.)
I can really recommend reading the Pro Git book. After reading you pretty much understand the internals of Git. It's available for free under http://www.pro-git.org or available as printed version at your favorite book dealer.

Kind regards

Steffen Gebert
TYPO3 v4 Core Team Member

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org
Before posting to this list, please have a look to the posting rules on the following websites:

TYPO3-team-core mailing list
TYPO3-team-core at lists.typo3.org

More information about the TYPO3-team-core mailing list