Reputation:
I am trying to clone repo. But doing so only get .git folder and not main files and folders. It shows success. But still not showing actual files and folders. It also shows receives objects (like 100% (2345/2345), 5.5 MB ). But not getting it in actual.
I used following command (which works for other repos).
git clone https://gitlab.com/myusername/test.git
Git Status Shows Following.
git status
On branch master
Initial commit
nothing to commit (create/copy files and use "git add" to track)
git branch -avv shows following results.
git branch -avv
remotes/origin/dev 0098fc5 cosmetics
remotes/origin/release 2bf6eed rework oidc-client js sample logging code (#178)
Git Version shows following result.
git version
git version 2.10.2.windows.1
Upvotes: 4
Views: 7763
Reputation: 1330102
Your branch master seem to have just one initial empty commit
Switch to develop
git checkout --track -b dev origin/dev
That should detect origin/dev
and track it.
Since master
is the default branch being cloned, that is what you see by default when cloning a GitHub repo.
See also "What determines default branch after “git clone
”?"
One way to avoid all this is to make sure the GitHub repo sets 'dev
' as its default branch.
Upvotes: 3
Reputation: 388463
This:
$ git status
On branch master
However:
$ git branch -avv
remotes/origin/dev 0098fc5 cosmetics
remotes/origin/release 2bf6eed rework oidc-client js sample logging code (#178)
So you are on the master
branch, when there is no actual master branch on the remote. That’s why the working directory is empty and that’s why git status
tells you “Initial commit”.
You simply need to check out dev
:
git checkout dev
Or explicitly:
git checkout -b dev origin/dev
Upvotes: 1