Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Why does Git ignore certain files and ALL directories, even with empty .gitignore?

Emilio Ferreira April 14, 2022

I started Git in the root directory of the project, WITH GITIGNORE EMPTY, downloaded Wordpress and added it to the root of this project. The problem is that after using Git Status, the list to add tracking does not show hundreds of files and all Wordpress root directories.

 

What am I doing wrong? I wanted to start the project with all the Wordpress files and then push them to the repository. Only after that will I add files and directories to be ignored by Git.

 

tks

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 20, 2022

Hi Emilio and welcome to the community.

It is possible that there is a global gitignore file on your machine, which includes patterns to be ignored for all repositories.

I would suggest running the command

git config --list

and check if the variable core.excludesFile is displayed in the output, and if so, what is its value. This configuration variable is used to set a global gitignore, and if set, you can check the patterns in that file.

I wanted to start the project with all the Wordpress files and then push them to the repository. Only after that will I add files and directories to be ignored by Git.

Please keep in mind that if you first commit e.g. *.jpg files in a repo, and then you add a .gitignore with *.jpg, the .jpg files that you already committed will not be ignored.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events