pygit2 icon indicating copy to clipboard operation
pygit2 copied to clipboard

pygit2: How to implement `git clone --single-branch`?

Open leiless opened this issue 1 year ago • 0 comments

$ git clone -h
usage: git clone [<options>] [--] <repo> [<dir>]
...
    -b, --branch <branch>
                          checkout <branch> instead of the remote's HEAD
...
    --single-branch       clone only one branch, HEAD or --branch

Hi, all. git clone has an option (i.e. --single-branch) to specify only clone one branch. Just wonder if anyone knows how to implement this functionality with pygit2?

With --single-branch, git branch -a will has only one branch, not all remote branches.

--

Might be helpful: https://github.com/libgit2/libgit2/issues/2924 https://github.com/nodegit/nodegit/issues/1669

leiless avatar May 15 '24 06:05 leiless