Re: Clone with local alternates?
- From
Eric W. Biederman <ebiederm@xmission.com>
- Date
- Apr 19, 2006, 09:36 UTC
- Message-ID
- <m1vet5oqk9.fsf@ebiederm.dsl.xmission.com>
- In-Reply-To
- <1145404132.16166.97.camel@shinybook.infradead.org>
David Woodhouse <dwmw2@infradead.org> writes:
Show 7 quoted lines
> Often I want to clone a remote repository but would like to use an > existing local source tree as 'alternates'. > > One way of doing this is to clone the local tree with 'git-clone -l -s', > find the latest common commit shared with the remote tree to be fetched, > revert to that with 'git-reset --head $last' and then pulling from the > remote.
Simpler than the git-reset you can simply do git-fetch remote branch:branch and git will find common ancestor for you and create a new branch that mirrors the old one.
I mention this because it can be interesting to have branches from several remote repositories all in one local repository.
Eric