How to create a branch without any links to the others branches

7 messages, 3 authors, 2016-06-15 · open the first message on its own page

How to create a branch without any links to the others branches

From: Francis Moreau <hidden>
Date: 2016-06-15 22:45:15

Hello,

I'm wondering how such branches are created in a repository.

For example, how todo, man and html branches from the git repository
have been created ?

Looking at git-branch man, a "start-point:" must be specified if not the
current branch is assumed.

The only solution I'm seeing is to create a new repository with these
'unrelated' branches and pull them from the other repository.

Is this correct ?

Thanks
-- 
Francis

Re: How to create a branch without any links to the others branches

From: Alex Riesen <hidden>
Date: 2016-06-15 22:45:15

2008/8/29 Francis Moreau [off-list ref]:
The only solution I'm seeing is to create a new repository with these
'unrelated' branches and pull them from the other repository.

Is this correct ?
Almost:

$ rm .git/HEAD
$ echo ref: refs/heads/NEW-BRANCH-NAME > .git/HEAD
$ git commit

Re: How to create a branch without any links to the others branches

From: Francis Moreau <hidden>
Date: 2016-06-15 22:45:15

On Fri, Aug 29, 2008 at 11:27 AM, Alex Riesen [off-list ref] wrote:
$ rm .git/HEAD
$ echo ref: refs/heads/NEW-BRANCH-NAME > .git/HEAD
$ git commit
well, it looks pretty git internal hack thing to me.

Shouldn't we add a new option to git-branch to do that, like:

    $ git branch --detach <new-branch>

?
-- 
Francis

Re: How to create a branch without any links to the others branches

From: Alex Riesen <hidden>
Date: 2016-06-15 22:45:15

2008/8/29 Francis Moreau [off-list ref]:
On Fri, Aug 29, 2008 at 11:27 AM, Alex Riesen [off-list ref] wrote:
quoted
$ rm .git/HEAD
$ echo ref: refs/heads/NEW-BRANCH-NAME > .git/HEAD
$ git commit
well, it looks pretty git internal hack thing to me.

Shouldn't we add a new option to git-branch to do that, like:

   $ git branch --detach <new-branch>
Dunno. I never needed that explicitly. What do you want to do with it?

Re: How to create a branch without any links to the others branches

From: Francis Moreau <hidden>
Date: 2016-06-15 22:45:15

On Fri, Aug 29, 2008 at 11:46 AM, Alex Riesen [off-list ref] wrote:
Dunno. I never needed that explicitly. What do you want to do with it?
I'd like to create branches as Junio did for html, man and todo ones.

Thanks
-- 
Francis

Re: How to create a branch without any links to the others branches

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:45:15

On 8/29/08, Francis Moreau [off-list ref] wrote:
On Fri, Aug 29, 2008 at 11:27 AM, Alex Riesen [off-list ref] wrote:
 >
 > $ rm .git/HEAD
 > $ echo ref: refs/heads/NEW-BRANCH-NAME > .git/HEAD
 > $ git commit
 >


well, it looks pretty git internal hack thing to me.
There is an old thread that uses "git symbolic-ref" or something
instead of "echo...", it would look less hacky. Or you could create a
new repository, make a new branch there, then pull that branch to your
repository.
-- 
Duy

Re: How to create a branch without any links to the others branches

From: Francis Moreau <hidden>
Date: 2016-06-15 22:45:15

On Fri, Aug 29, 2008 at 2:34 PM, Nguyen Thai Ngoc Duy [off-list ref] wrote:
There is an old thread that uses "git symbolic-ref" or something
instead of "echo...", it would look less hacky.
OK.
Or you could create a new repository, make a new branch there,
then pull that branch to your repository.
yes it's the only soultion I could come up with but I would have assumed
git-branch to be able to do that.

Thanks
-- 
Francis
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help