Re: Getting Commits from One Repository to Another

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

 



Jeff King <peff@xxxxxxxx> writes:

> On Wed, May 20, 2009 at 07:37:54PM -0400, Big Lebowski wrote:
>
>> Essentially, when I came on a project, a git repository was made  
>> available to me (lets call that 'public_repo'). That repository was put up 
>> on an unfuddle account, as an initial check-in; it was not cloned from the 
>> repository they were working on (lets call that 'private_repo'). I wrote 
>> some code, and pushed it to the repository. Now that I guess they feel 
>> comfortable with me, they reveal to me the private_repo.
>>
>> How do I get my code from public_repo to private_repo?
>
> You could just repeat the push you made to public_repo to
> private_repo.

As I understand the situation, no, because the public repo was not a
clone of the private one, but a fresh import (without history?).
So, the ancestor of the commits of the OP do not exist in the private
repository.

But don't panic, "git rebase" will be able to replay your history on
another branch. The commands to type will be along the lines of:

cd public-repo
git remote add private url-of-private-repo
git fetch private
# not sure about the exact syntax here:
git rebase  --onto private/master your-first-commit^ master

and then perhaps

git push private master

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