Why is git clone not copying source files to my local directory?
First, git said it received 84.6 MiB of objects, so sanity check:
du -hs .git/objects
If it's empty, perhaps you are not actually in the target folder.
-
If it's not empty,
git log --all
. This just asks git log to follow all refs fromrefs/
.You might discover that the source files were there before, but were removed in a subsequent commit. If so, just
git checkout
to an older commit.Also possible that there's simply no files in the
master
branch (git log --all
will show other branches). Seegit branch
for list andgit checkout
another branch. If that's empty, manually inspect
.git/refs/heads
,.git/refs/remotes
, and finally.git/objects
. GitHowTo has a good overview of .git directory structure.
JohnB
Seasoned software professional looking for new challenging oppportunities.
Updated on July 17, 2022Comments
-
JohnB almost 2 years
I'm running into issues using git clone. When I run the command to clone a repository, the git command looks like it completes successfully.
git clone ssh://[email protected]:29418/sourceName
I get the following results:
ssh://[email protected]:29418/sourceName Cloning into 'sourceName'... Warning: Permanently added '[192.168.2.4]:29418' (RSA) to the list of known hosts. remote: Counting objects: 14091, done remote: Finding sources: 100% (14091/14091) remote: Total 14091 (delta 10639), reused 13901 (delta 10639) Receiving objects: 100% (14091/14091), 84.60 MiB | 204.00 KiB/s, done. Resolving deltas: 100% (10639/10639), done. Checking connectivity... done.
So, it looks like it's cloning successfully. But when I look at the target folder, I see only the .git folder gets created and populated.
No source files get copied locally as part of the clone.
I don't see any error messages. What could be going wrong? How do I "debug" this?
Thanks, JohnB