3

When I fire the below command:

git clone <url>

I can just see 1 folder and in that folder just 1 file viz .gitkeep.

Why my other folders and files arent getting downloaded?

8
  • 3
    Most likely those other files are not committed. Commented Jun 29, 2020 at 16:10
  • 4
    In order to answer this, we will need some more information. What files are missing? Is there a gitignore? Are there any errors or warnings when you run git clone? Are any of the missing folders empty?
    – LLSv2.0
    Commented Jun 29, 2020 at 16:10
  • Is it by any chance a public repo so we can take a look? And post the command output of git clone <url>
    – Teharez
    Commented Jun 29, 2020 at 16:33
  • @LLSv2.0 no, there is no gitignore. No errors are encountered when git clone is run. Does having empty folder prevent downloading of other folders? Commented Jun 29, 2020 at 18:03
  • @Teharez its not a public repo. Yes will surely post the output of git clone Commented Jun 29, 2020 at 18:04

1 Answer 1

8

Since, you have mentioned that there isn't .gitignore file, There is a chance that the files that aren't getting downloaded are committed in another branch. Make sure you git checkout to that branch and search for what you want.

2
  • This answer solves my problem. I was trying to clone on the main branch but I need to clone on a different branch. I did the following steps. 1. git branch (to check the current branch) 2. git checkout <branch-name> (to switch to new branch) 3. git clone <url> Now I was able to clone the code on my local. Commented Aug 17, 2021 at 17:51
  • Thank you! In Visual 2022 after cloning simply switched to the correct branch (dropdown on the bottom right) Commented May 13, 2022 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.