Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT clone not getting files starting with a dot (.htaccess,.htpasswd)

I'm cloning a repository from Github with GIT, in a remote environment running CentOs, using:

git clone https://myuser:[email protected]/Myrepository/repo.git

and is checking out all the files, except the ones starting with a dot

.htaccess .htpasswd

Notes:

  1. The missing files show up on the Github repository

github

  1. These files are not included in .gitignore
  2. I'm listing the files on the server by using ls -a command

server

Is there any flag I need to add in order to checkout these files too?


[SOLUTION]

The problem wasn't with the git clone command, the missing dotfiles were due to another command executed afterwards

mv /path/one/* /path/two

Which moved everything except the dotfiles.

Thanks for your replies!

like image 241
J Plana Avatar asked Jan 07 '16 20:01

J Plana


1 Answers

Please note that "dotfiles" are usually hidden by default in most operating systems. This applies whether you are using User or Command Line Interface.

If using CLI try adding -a flag to ls when listing the files in the git repo:

ls -a

As seen in man ls:

-a Include directory entries whose names begin with a dot (.).

like image 185
mathielo Avatar answered Oct 09 '22 02:10

mathielo