git icon indicating copy to clipboard operation
git copied to clipboard

Can i git clone / commit / push with this? Or is this lib for reading, stat

Open softmarshmallow opened this issue 5 years ago • 4 comments

Does this library follows libgit2 or just a simple wrapper for reading git stats, not having actual source on the local device

softmarshmallow avatar Jul 25 '20 03:07 softmarshmallow

Same Question here, would need that feature

phibr0 avatar Nov 02 '20 07:11 phibr0

To answer that question:

the git package has an interface that allows to run any command by using the runCommand method from a GitDir instance.

Therefore, you could clone, commit, push with this package.

jenshor avatar May 28 '22 07:05 jenshor

GitDir doesn't have a default constructor and the only two static functions exposed are FromExisting() and Init(). How do I clone a new repo?

GibreelAbdullah avatar Jun 17 '22 15:06 GibreelAbdullah

@GibreelAbdullah it looks like this is currently not supported. But you could just use the Process class from dart:io:

final pr = await Process.run('git', args, workingDirectory: processWorkingDir, runInShell: true);

args would then be something like ['clone', url].

This is also how the git package runs the commands.

jenshor avatar Jul 08 '22 11:07 jenshor