Open AtkinsSJ opened 6 months ago
Isomorphic-git's init({gitdir:<path to gitdir>})
doesn't quite behave as Canonical Git git init --separate-git-dir=<path to gitdir>
.
Canonical Git, creates a .git
file with a link to <gitdir>
. While isomorphic-git just directly creates <gitdir>
, and you have to pass it for each subsequent command.
I'm curious what's your use case for supporting --separate-git-dir
?
I'm curious what's your use case for supporting
--separate-git-dir
?
The use case is roughly "copy canonical git's command line and functionality". You can find the app here: https://github.com/HeyPuter/puter/tree/main/packages/git It's part of a whole cloud OS, and the idea is someone could use it from Puter's terminal just like they would on any other OS.
@hhourani27 I think that git.init({gitdir})
is creating a new git bare repo, not changing the git directory. It's by design.
I'm developing a browser-based git client using isomorphic-git, and noticed a couple of differences here against the official git client:
git init --separate-git-dir=foo
creates a.git
text file containinggitdir: /repo/foo/
. isomorphic-git does not do this.For the second one, it's possible that isomorphic-git just doesn't handle
git init
in an existing repo at all, but I'm not far enough with my client to know if that's the case. :sweat_smile:Neither of these is a big issue (because who even uses a different git dir?) but I thought it was worth reporting anyway. 🙂
I'm using isomorphic-git in the browser, bundled using rollup.