Jed
Jed

Reputation: 1733

Would .gitignore items in the remote repository be copied in the local project repository by git clone?

Say, If I have a git repo established in the repository ssh://[email protected]:port/home/user/public_html/,

and I'd like to clone it in my local project's directory, would the appended items in my remote host's .gitignore be included in the cloning of my public_html/.git repository?

local$ git clone ssh://[email protected]:port/home/user/public_html/

Upvotes: 0

Views: 113

Answers (1)

alfunx
alfunx

Reputation: 3150

The sole purpose of the .gitignore files is to ensure that untracked files remain untracked. The moment a file is tracked, for example when you intentionally did

git add --force path/to/ignored-file

that moment the .gitignore file lost its might over that file. So, if your remote repository contains a file that is listed in the .gitignore file, that file will still remain there in the remote repository, as well as in your clone.

Upvotes: 1

Related Questions