Re: how to combine two clones in a collection

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

 



also sprach robin:
> And the simplest way to create an new indpendent branch:

> echo ref: refs/heads/newbranch >.git/HEAD
> Then prepare the content and commit like you used to do.

Hi Robin, thanks for this nice suggestion, which doesn't only
createa a new, independent branch, it also teaches me yet a bit
more about git.

I am a little uneasy about touching files in .git with non-git
tools, but everyone seems to be doing it, so I guess it's okay, and
it make git a lot more powerful too.

Anyway, I tried your method and there is one small problem:

  piper:~> git init-db
  Initialized empty Git repository in .git/
  piper:~> date > date; git add date; git commit -m.
  Created initial commit 2dd8d6f: .
  1 files changed, 1 insertions(+), 0 deletions(-)
  create mode 100644 date
  piper:~> echo ref: refs/heads/newbranch >| .git/HEAD
  piper:~> git status
  # On branch newbranch
  #
  # Initial commit
  #
  # Changes to be committed:
  #   (use "git rm --cached <file>..." to unstage)
  #
  #       new file: date
  #

If I were to run commit now, the file 'date' would become part of
the first commit to newbranch. But it's already in the master
branch.

Is there anyway I can prevent this and start a new branch from
scratch without having to unstage all previous additions?

Thanks,

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:"; net@madduck
 
spamtraps: madduck.bogus@xxxxxxxxxxx
 
"anyone who is capable of getting themselves made president
 should on no account be allowed to do the job"
                                                      -- douglas adams

Attachment: signature.asc
Description: Digital signature (GPG/PGP)


[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]

  Powered by Linux