Diego-MX
Diego-MX

Reputation: 2349

.gitignore incoming or outgoing?

What I'm trying to do is to have different versions of a file locally and in the master version of the project. So I'm including it in my .gitignore files. However I'm still getting errors when pulling and pushing commits.

To clarify this my question is the following. Are the patterns in my local .gitignore ignored when pulling requests, or are they to be ignored when pushing changes?

Thanks.

Upvotes: 1

Views: 414

Answers (1)

Jonathan.Brink
Jonathan.Brink

Reputation: 25413

The .gitignore file is taken into account when Git is staging files.

So, if you have entries in your .gitignore file locally and pull content that you previously tried to ignore you are too late...the content is already tracked by Git.

You will need to take measures to make that content not tracked for them to become ignored.

See this answer for steps on how to "de-track" content: How to stop tracking and ignore changes to a file in Git?

Upvotes: 1

Related Questions