Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Abillity to clone git repository in non-empty folder [feature-request]

Aberta
#1,075 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
35/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
git, python
Domínio
api

Direção de pesquisa

Comece executando a reprodução em Python para pygit2.clone_repository com "." e bare=True. Inspecione pygit2/init.py ao redor da definição de clone_repository na linha 165; a alteração estará concluída quando a clonagem para a pasta não vazia demonstrada funcionar sem o workaround, preservando o comportamento existente.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

When I try to clone a repository using the pygit2.clone_repository function, it keeps giving me a '.' exists and is not an empty directory error. I can solve this by appending a backward slash / to the pathstr. I, however, for my project, need to be able to clone multiple repositories next to each other inside a catkin workspace. There are several easy workarounds for this problem, but I wondered if this is supported out of the box. I think supporting this out of the box would be more in line with how the bash git client clones git repositories.

How to reproduce

  1. Run the following code in python.
import pygit2
repo_url = "https://bitbucket.org/theconstructcore/spawn_robot_tools.git"
pygit2.clone_repository(repo_url, ".", bare=True)
  1. See the not empty folder error.

Example work-around

import pygit2
repo_url = "https://bitbucket.org/theconstructcore/spawn_robot_tools.git"
pygit2.clone_repository(repo_url, "./"+repo_url.split("/")[-1].replace(".git", ""), bare=True)
Linguagem predominante
Python
Estrelas
1.7k
Forks
408
Merge médio
2d 57min
PRs com merge (30d)
7

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de libgit2/pygit2

Todas as issues de libgit2/pygit2

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.