Hacker News new | ask | show | jobs
by js2 25 days ago
Yes:

    $ git init foo
    Initialized empty Git repository in .../foo/.git/
    $ git clone "file://$PWD/foo" bar
    Cloning into 'bar'...
But it's redundant:

   $ git clone bar baz    
   Cloning into 'baz'...
If you example .git/config in either clone, you'll see that remote.origin.url is the absolute path of the source repo.

Note that you can share objects across clones on the same machine in various ways. See "--local", "--shared", and "--reference" in the git-clone man page. (GitHub uses this feature heavily. Or at least they did. I have no idea what their backend implementation is these days, but they must be doing some sort of copy-on-write CAS for forks.)

1 comments

Good to know, thanks. I should try it with vim.pack for local repos.