New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloning to current directory? #1087
Comments
It seems like using Edit: Accidentally closed the issue. |
Could you check if you have already initialized git repository in the current directory? |
Is that necessary for cloning a repository? |
If you clone a repository via PlainClone, go-git will use |
Oh, I see. Is there any way for cloning without initializing |
You can store repository in memory. package main
import (
"github.com/go-git/go-billy/v5/memfs"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/storage/memory"
)
func main() {
fs := memfs.New()
s := memory.NewStorage()
r, err := git.Clone(s, fs, &git.CloneOptions{
URL: "your git repository",
})
} You might want to avoid using memory storage if you are cloning large repository or etc. |
That looks helpful, thanks. But I would like to stick to the PlainClone because storing it in memory is not possible due to memory constraints. I can work on a PR for this if you want to consider it as an option. |
I'm not sure if this project is planning on supporting this kind of use case. |
Hello, I wanted to clone a repository to the current directory and therefore I used ".".
But that doesn't seem to working. I get the following error:
What's the current way to clone to current directory?
The text was updated successfully, but these errors were encountered: