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

Re: How to stop sharing objects between repositories

From
DVDaniel Villeneuve <daniel2villeneuve@videotron.ca>
Date
Aug 16, 2009, 13:54 UTC
Message-ID
<4A880F89.3060702@videotron.ca>
In-Reply-To
<alpine.DEB.1.00.0908161429590.8306@pacific.mpi-cbg.de>
Johannes Schindelin wrote:
> Hmm.  I really would like a documentation patch, then.
>
>   
As another way to do it, I've used something along the lines from
    http://article.gmane.org/gmane.comp.version-control.git/62062
namely:

<script> gitdir=$(git rev-parse --git-dir) [ -n "$gitdir" ] || die "cannot find Git directory"

cd "$gitdir"
a=objects/info/alternates
if [ -f $a ]; then
  git rev-parse --all HEAD | git pack-objects --revs objects/pack/pack
  rm $a
fi
</script>

I was not sure HEAD would be included via --all (e.g. HEAD pointing to a dangling commit), so I added it explicitly.

The reverse operation (enabling sharing for a standalone repository) is 
described here
    
http://git.or.cz/gitwiki/GitFaq#Howtoshareobjectsbetweenexistingrepositories.3F

-- Daniel

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 5 of 18 in “How to stop sharing objects between repositories”
  1. Jon JensenAug 16, 2009
  2. Johannes SchindelinAug 16, 2009
  3. Jeff KingAug 16, 2009
  4. Johannes SchindelinAug 16, 2009
  5. Daniel VilleneuveAug 16, 2009
  6. Johannes SchindelinAug 16, 2009
  7. Jeff KingAug 16, 2009
  8. Junio C HamanoAug 16, 2009
  9. Mike GalbraithAug 17, 2009
  10. Jeff KingAug 17, 2009
  11. Mike GalbraithAug 17, 2009
  12. Junio C HamanoAug 17, 2009
  13. Jeff KingAug 17, 2009
  14. Junio C HamanoAug 17, 2009
  15. Jeff KingAug 17, 2009
  16. Jeff KingAug 17, 2009
  17. Jeff KingAug 17, 2009
  18. Jeff KingAug 17, 2009

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.