If I change my .gitignore file, does it change for everyone after I push the code?

Viewed 133

I don't want certain things to be going with my PRs, so I have changed my .gitignore, but I was wondering if I change my .gitignore file, would it change for everyone after I push my code?

[This is my first internship, sorry if the question is too basic]

1 Answers

If you are talking about a global gitignore file outside the working tree, no.

If you are talking about a local gitignore file inside your working tree, then yes, it would work like any other file; it would affect someone else only if you push and they switch to the same branch and pull it.

Note that this will not affect any files / folders already present in the head commit.

Related