[TYPO3-core] How to set up Git GUI client with SSH-RSA key on Windows
steffen.gebert at typo3.org
Sun Jun 5 21:02:40 CEST 2011
> 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.
TYPO3 v4 Core Team Member
TYPO3 .... inspiring people to share!
Get involved: http://typo3.org
More information about the TYPO3-team-core