4

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
  • What `git status` and `git branch -avv` and `git version` return? (you ca edit your question) – VonC Aug 27 '17 at 13:44

2 Answers2

3

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Is master branch default? –  Aug 27 '17 at 14:37
  • 1
    @AddDev Yes. I have edited the answer to make that clearer. I have also added a link to https://help.github.com/articles/setting-the-default-branch/, in order for the GitHub repo to define dev as the default branch, which would avoid this issue. – VonC Aug 27 '17 at 14:39
1

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
poke
  • 369,085
  • 72
  • 557
  • 602