git-reference icon indicating copy to clipboard operation
git-reference copied to clipboard

git clone, should it also clone the hidden dot gitignore (.gitignore)

Open lsatenstein opened this issue 4 years ago • 2 comments

I was cloning my git repository to a new one. One thing I discovered is the ".gitignore" was not included within the new cloned repository.

Should it be copied across as well?

lsatenstein avatar Dec 21 '20 23:12 lsatenstein

hi @lsatenstein ! which repository were you attempting to clone?

typically yes, a .gitignore would be copied as well.

brntbeer avatar Dec 22 '20 07:12 brntbeer

"dotfiles" are usually hidden by default in most operating systems,.Cloning has nothing to do with .gitignore, the reason those files aren't being cloned is most likely that... well... they're ignored! So if you want to file "X" in the repo (and as a result, in clones) then simply add that file to the repo with git add -f X and commit it. for more, you also refer to the [https://github.com/git-tfs/git-tfs/issues/1291] !!

vikky-10 avatar Mar 21 '21 21:03 vikky-10