git / git-reference

Online Git Reference at http://git.github.io/git-reference/
Other
996 stars 363 forks source link

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

Open lsatenstein opened 3 years ago

lsatenstein commented 3 years ago

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?

brntbeer commented 3 years ago

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

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

vikky-10 commented 3 years ago

"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] !!