How to stop sharing objects between repositories

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

 



Hello.

Situation: I used "git clone -s" to share objects between repositories. That creates .git/objects/info/alternates, which points to the other repository. Later I need to remove the dependency and make the dependent repository self-sufficient, i.e. it should have all the objects internal to itself.

I've looked around for a way to do that but haven't found either tools or instructions.

I came up with this manual way, copying over the unique remote objects and then removing the alternate repository pointer:

(cd /path/to/alternate/repo.git/objects && tar cp .) | (cd .git/objects && tar xvpk)
# some objects will already exist and be skipped, leading to an error on exit, which is fine
rm .git/objects/info/alternates
# or if there's more than one and you're only removing one, edit the alternates file and remove only that pointer

(With GNU tar -C the copy is a little simpler.)

I posted this to the wiki:

http://git.or.cz/gitwiki/GitFaq#Howtostopsharingobjectsbetweenrepositories.3F

If there's a better or built-in way to do this with Git tools, I'd like to learn it, and I'd be happy to update the wiki accordingly.

Thanks,
Jon

--
Jon Jensen
End Point Corporation
http://www.endpoint.com/
--
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]