RE: how to clone/checkout branch/tag vesion from GIT repository

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jeff,

Thanks for your prompt reply.

Please see my reply below:

1- Side note: if I repeat your experiment, I get "br6-1-0" in the error message (i.e., what was on the command line). Is this just a cut and paste mistake in reporting the error, or is that actually what you see?

Suchi - yes my mistake in cut & paste. Branch name is br6-1-0

2- for branch:
$ git checkout br6-1-0

Suchi - As per my understanding with GIT this command will create a new branch in my repository..for ex. If I run "git checkout suchi" then it will create suchi as a new branch.

2.1 Note that if you are planning on doing work based on the tag, you probably want to create a new branch, like:
  $ git checkout -b my-work br6-1-0

Suchi - Yes, I have this branch br6-1-0 and data is associated there, this branch is different from head. For end user perspective I just want to make sure that my data is there or not so I performed clone but not working (Again not sure which command I have to use).

Please note that  - branch br6-1-0 created in CVS and then our source code migrated to Git. But in migration output I can see the br6-1-0 picked up for copying ...


3- In your local clone, or on the remote? In the local clone, you can use "git branch" to see local branches, or "git branch -a" to see branches copied from the remote. To see what is available on the remote, try "git ls-remote ssh://...".

Suchi - I want a branch list from remote. I have run your suggested command  but it shows only tag list and no branch.


Thanks,
Suchi

-----Original Message-----
From: Jeff King [mailto:peff@xxxxxxxx] 
Sent: Thursday, May 10, 2012 7:26 PM
To: Suchi Upadhyay
Cc: git@xxxxxxxxxxxxxxx
Subject: Re: how to clone/checkout branch/tag vesion from GIT repository

On Thu, May 10, 2012 at 06:39:47AM -0700, supadhyay wrote:

> I try to use below command to do clone from particular branch/version 
> number. I used below command...
> 
> $ git clone -b br6-1-0 ssh://gitolite@myservername/testrep
> Cloning into 'testrep'...
> remote: Counting objects: 19536, done.
> remote: Compressing objects: 100% (5850/5850), done.
> remote: Total 19536 (delta 13869), reused 18869 (delta 13202) 
> Receiving objects: 100% (19536/19536), 61.44 MiB | 17 KiB/s, done.
> Resolving deltas: 100% (13869/13869), done.
> warning: Remote branch br6-0 not found in upstream origin, using HEAD 
> instead

Side note: if I repeat your experiment, I get "br6-1-0" in the error message (i.e., what was on the command line). Is this just a cut and paste mistake in reporting the error, or is that actually what you see?

Assuming that is the case, the problem is that git versions before
v1.7.10 did not expect a tag name with the "-b" switch. Either upgrade to git v1.7.10, or clone and manually switch to the tag, like this:

  $ git clone ssh://.../testrep
  $ cd testrep
  $ git checkout br6-1-0

Note that if you are planning on doing work based on the tag, you probably want to create a new branch, like:

  $ git checkout -b my-work br6-1-0

> Is there any way to findout how many branches are available in my GIT 
> repository.

In your local clone, or on the remote? In the local clone, you can use "git branch" to see local branches, or "git branch -a" to see branches copied from the remote. To see what is available on the remote, try "git ls-remote ssh://...".

-Peff
��.n��������+%������w��{.n��������n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]