Re: clarify git clone --local --shared --reference

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Loeliger Jon-LOELIGER <jdl@...>
Cc: Shawn O. Pearce <spearce@...>, <git@...>
Date: Friday, June 8, 2007 - 2:35 pm

Loeliger Jon-LOELIGER wrote:

I don't think that exact behavior is implemented yet, but...

If the filesystem-local repo is pure subset version of the source repo 
you could do this:

(assuming the filesystem-local repo is on branch master, and that is 
what you want)
git clone -l <filesystem-local repo> <my_new_repo>
cd <my_new_repo>
git pull <source-repo>

No reason not to use -l on clone in this case IMO.

Otherwise...
If the filesystem-local repo has changes past the master HEAD on source 
repo that you are not necessarily interested in...

1) git clone -l -n <filesystem-local repo> <my_new_repo>
2) cd <my_new_repo>
3) git fetch <source_repo> master:tmp
4) git branch -M tmp master
5) git checkout master

1) Here we use -l to encourage hard linking (no reason not to IMO),
    and tell clone not (-n) to checkout the active branch.
3) Now fetch the master branch from the source_repo and store into
    a new branch named tmp.
4) Rename tmp to master.
5) Checkout the files.
- Now the HEAD of master branch is at the same commit as the
   source_repo.

One drawback is that origin is now tracking the filesystem-local repo, 
so a git pull without supplying a repo will pull from filesystem-local repo.

-brandon

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
clarify git clone --local --shared --reference, Brandon Casey, (Mon Jun 4, 7:53 pm)
Re: clarify git clone --local --shared --reference, Shawn O. Pearce, (Tue Jun 5, 12:50 am)
Re: clarify git clone --local --shared --reference, Brandon Casey, (Tue Jun 5, 12:30 pm)
Re: clarify git clone --local --shared --reference, Shawn O. Pearce, (Wed Jun 6, 1:11 am)
Re: clarify git clone --local --shared --reference, Brandon Casey, (Wed Jun 6, 2:50 pm)
Re: clarify git clone --local --shared --reference, Shawn O. Pearce, (Fri Jun 8, 1:37 am)
Re: clarify git clone --local --shared --reference, Brandon Casey, (Wed Jun 13, 7:07 pm)
RE: clarify git clone --local --shared --reference, Loeliger Jon-LOELIGER, (Fri Jun 8, 11:57 am)
Re: clarify git clone --local --shared --reference, Brandon Casey, (Fri Jun 8, 2:35 pm)
Re: clarify git clone --local --shared --reference, Brandon Casey, (Wed Jun 6, 2:55 pm)