Re: importing two different trees into a fresh git repo

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

 



On Tue, Feb 05, 2013 at 01:46:09PM -0800, Constantine A. Murenin wrote:

> I've encountered two problems so far:
> 
> 0. After initialising the repository, I was unable to `git checkout
> --orphan Debian-6.0.4-nginx-1.0.12` -- presumably it doesn't work when
> the repo is empty?  This sounds like a bug or an artefact of
> implementation.  I presume this can be worked around by committing
> into master instead, and then doing `git checkout -b
> Debian-6.0.4-nginx-1.0.12`, and then force-fixing the master somehow
> later on.

What version of git are you using? Using both "-b" and "--orphan" from a
non-existing branch used to be broken, but was fixed by abe1998 (git
checkout -b: allow switching out of an unborn branch, 2012-01-30), which
first appeared in git v1.7.9.2.

> 1. After making a mistake on my first commit (my first commit into
> OpenBSD-5.2-nginx-1.2.2 orphan branch ended up including a directory
> from master by mistake), I am now unable to rebase and "fixup" the
> changes -- `git rebase --interactive HEAD~2` doesn't work, which, from
> one perspective, makes perfect sense (indeed there's no prior
> revision), but, from another, it's not immediately obvious how to
> quickly work around it.

You cannot ask to rebase onto HEAD~2 because it does not exist (I'm assuming
from your description that HEAD~1 is the root of your repository). But
you can use the "--root" flag to ask git to rebase all the way down to
the roots, like:

  git rebase -i --root

However, note that older versions of git do not support using "--root"
with "-i". The first usable version is v1.7.12.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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