[Ktechlab-devel] Checking out Julian's repository, how?

Julian Bäume julian at svg4all.de
Sat Nov 28 22:19:53 UTC 2009


Moin,
On Saturday 28 November 2009 18:56:05 P Zoltan wrote:
> $ git clone
> git://ktechlab.git.sourceforge.net/gitroot/ktechlab/ktl-j_ohny_b
> Initialized empty Git repository in /tmp/3/ktl-j_ohny_b/.git/
> remote: Counting objects: 3832, done.
> remote: Compressing objects: 100% (1255/1255), done.
> remote: Total 3832 (delta 2552), reused 3816 (delta 2543)
> Receiving objects: 100% (3832/3832), 4.03 MiB | 1126 KiB/s, done.
> Resolving deltas: 100% (2552/2552), done.
> warning: remote HEAD refers to nonexistent ref, unable to checkout.
> 
> Then I get a directory with only a .git/ subdirectory in it.
That is correct. The point is, I don't have a master branch uploaded to my 
repository. That is why it can't checkout anything. You have to do it 
manually. Try:

git checkout --track -b kde4-port origin/kde4-port

(here I assume, the remote repo is named origin) You can list all remote 
branches with git branch -a
 
> What am I doing wrong?
Nothing. I assume, you have got another clone of the repository somewhere? It 
is possible to use different remote repositories in one local one. I have the 
following setup:

one folder "~kde/src/ktechlab", where everything is stored. I created it by 
cloning my devel repository on sf.net. I suggest that every developer does the 
same. After that you can add remote repositories like this (I'll take your 
above example to fill in some values):

git remote add j_ohny_b 
git://ktechlab.git.sourceforge.net/gitroot/ktechlab/ktl-j_ohny_b

After adding it, all branches show up in git branch -a

Then you can checkout the branch containing the port of ktlproject, I started 
to port the project management.

git checkout --track -b kde4-ktlproject  j_ohny_b/kde4-ktlproject

--track option means, you want to follow the remote branch, so you can do git 
pull on that branch, and it will pull  j_ohny_b/kde4-ktlproject automatically. 
-b will create a new (local) branch called kde4-ktlproject

I hope, I made clear, how things work. I know, branching can be quite 
confusing, but it's really worth the effort and it will get more easy if you 
do it yourself and see, what benefits you get from doing it.

bye then
julian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/ktechlab-devel/attachments/20091128/98376cb7/attachment.sig>


More information about the Ktechlab-devel mailing list