git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: sharing between local "work" and "nightly build" git repos

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 13, 2007, 00:03 UTC
Message-ID
<7vmyy1rwza.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7154c5c60707121636l585b42d4l931b08f1468ddfc@mail.gmail.com>
"David Frech" <nimblemachines@gmail.com> writes:
Show 13 quoted lines
> I'd like to share as much as possible between the two repos. My naive
> first attempt was to clone the local repo (~david/git) using -l and -s
> (which I admit I do not completely understand). This sort of worked,
> but one issue is that doing a "git pull" in nightly is going to pull
> from the *locally*-cloned repo, not from the main git. Another is that
> a checkout in nightly failed with the obscure error:
>
> [david@tashtego ~/git-nightly]% git checkout -b nightly-next next
> git checkout: updating paths is incompatible with switching branches/forcing
> Did you intend to checkout 'next' which can not be resolved as commit?
>
> I assume this is because too much state is being shared the repos, and
> something is unfinished in the "git" directory.

You assumed wrong. "-l and -s" does not have to do anything with the above symptoms.

git-clone helps people by setting up the new repository to follow where you cloned from, but there is no rule that you cannot change it. Look at .git/config in the nightly repository and find [remote "origin"] section; update its URL to whichever repository you would want to track from and you are done.

"git checkout -b nightly-next next" is telling git to:
 - create a new branch nightly-next starting from 'next'
 - check it out

You most likely would want to fork off of "origin/next", not 'next' which probably does not exist in your repository.

If you are willing to redo the nightly repository from scratch, I would probably recommend using --reference option when cloning, like this:

 $ git clone --reference ~david/git git://git.kernel.org/... ~/nightly-git
 $ cd ~/nightly-git
 $ git checkout --track -b next origin/next
Then a nightly update would go like this:
 $ cd ~/nightly-git
 $ git pull origin next
 $ make clean
 $ make test || barf
Previous: David FrechNext: David Frech
Message 2 of 6 in “sharing between local "work" and "nightly build" git repos”
  1. David FrechJul 12, 2007
  2. Junio C HamanoJul 13, 2007
  3. David FrechJul 13, 2007
  4. David FrechJul 13, 2007
  5. Alex RiesenJul 13, 2007
  6. Junio C HamanoJul 13, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.