Chen
Chen

Reputation: 117

Git clone failing with "initial ref transation called with existing refs"

I tried cloning my website repo and I got this error that I've never had before. I don't know if I should still try to use my local repo if its unstable.

chen@chen-laptop-uwu:/media/chen/storage/development/fleepy.tv$ git clone https://github.com/flleeppyy/fleepy.tv .
Cloning into '.'...
remote: Enumerating objects: 467, done.
remote: Counting objects: 100% (467/467), done.
remote: Compressing objects: 100% (282/282), done.
remote: Total 722 (delta 266), reused 358 (delta 172), pack-reused 255
Receiving objects: 100% (722/722), 30.34 MiB | 2.12 MiB/s, done.
Resolving deltas: 100% (356/356), done.
BUG: refs/files-backend.c:2956: initial ref transaction called with existing refs
Aborted (core dumped)

Upvotes: 5

Views: 6674

Answers (5)

Om Rastogi
Om Rastogi

Reputation: 1005

Adding the directory name to be cloned in, solved the bug (for me).

git clone https://github.com/user/reponame <dirname>

Upvotes: 0

wen
wen

Reputation: 955

In my case, I realized that I had created a folder, which only put the related preprocessing data, with the same name to a GitHub repository.

Specifically, the folder was located in a different path from where I had cloned repository, so I didn't notice this in the beginning. After renaming the folder I had created and refreshing VSCode. I was able to successfully clone the repository.

Upvotes: 0

Patrick Skinner
Patrick Skinner

Reputation: 21

It sometimes helps to initialize the directory you're in as a Git repository. To do that, run git init first.

Run this next time:

git init
git clone https://github.com/your-profile/your-repo.git

For additional details, read the documentation on cloning repos here: https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository

Upvotes: -2

Duloren
Duloren

Reputation: 2711

I just got this error after trying to clone a random repo from github.

In order to fix it, I just removed the incomplete repo folder and tried to clone it again. This last time I got no error.

Upvotes: 3

torek
torek

Reputation: 487755

Any Git output that begins with BUG: means Git has self-detected some kind of internal error. You should report the bug, and try installing a different (newer or older) Git version to see if that can get around it.

In this particular case, the fact that you used git clone <url> . (with a literal dot) to clone into the current directory might have something to do with it. You could try cloning into a directory that git clone itself makes, by leaving out the final .. That's just a guess, though.

Upvotes: 5

Related Questions