-1

I'm using M2 Macbook. I'm trying to bare clone this repo for a school assignment. Not sure what I did wrong, but what I get at local is totally different from the GitHub repo.

but every time I tried to bare clone an repo, it seems like I only got an empty repo.

This might be the reason that caused the issue but I'm not sure:

The first time I tried to bare clone the repository, instead of the cloning the correct assignment repository, I accidentally used a wrong URL that pointed to an empty repository I created in my own GitHub, which looked exactly like the one in above pic you see. Then I used command+delete to manually delete that whole folder on my desktop before tried to bare clone the correct repository.

I tried to bare clone different repositories but had the same issue - no matter what repositories I bare cloned, I got the same wrong stuff as in the screenshot above.

I'm not too familiar with git - tried different ways found on Google but failed.

Please help me! Thank you!

883km
  • 27
  • 4
  • https://stackoverflow.com/q/5540883/7976758 , https://stackoverflow.com/q/37992400/7976758 , https://stackoverflow.com/questions/tagged/git-bare – phd Oct 09 '22 at 08:59

1 Answers1

2

That is what a bare clone looks like.

It's not at all clear to me why you're making a bare clone in the first place. Users should never make bare clones. Bare clones exist so that servers can serve Git repositories. They are no good for doing any actual work; they are only good when acting as a server that receives work done elsewhere.

torek
  • 448,244
  • 59
  • 642
  • 775
  • Hi torek - I‘m a beginner and I'm simply following the assignment setup instruction - I have to bare clone the repo to local, and then push that local repo to my own GitHub, delete local repo and then clone repo from my own GitHub again. (sounds complicated i know but this is how it's set up so the auto- grader would wok) – 883km Oct 09 '22 at 07:54
  • In the previous two assignments where the setup were same as this one, everytime i bare clone the assignment repo, the local folder would look exactly like the Github repo, instead of an empty repo as in my screenshot. So please help me if you know the answer – 883km Oct 09 '22 at 07:59
  • If you didn't get a bare repository, you didn't use `--bare`. You don't *need* `--bare` to clone-and-push-to-GitHub. You might sometimes *want* `--mirror`, which implies `--bare`, for certain special purposes, and your instructor may have something else in mind here, but it's clear that your previous clones were not made with `--bare`. – torek Oct 09 '22 at 14:50