Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrongfully modifies .gitignore #506

Closed
XhmikosR opened this issue Sep 3, 2019 · 9 comments
Closed

Wrongfully modifies .gitignore #506

XhmikosR opened this issue Sep 3, 2019 · 9 comments

Comments

@XhmikosR
Copy link
Contributor

XhmikosR commented Sep 3, 2019

I already have this in my .gitignore file

/.netlify/

yet when I link the site the first time, netlify-cli modifies my .gitignore and adds this:


# Local Netlify folder
.netlify

It shouldn't modify .gitignore in this case.

Using netlify-cli/2.13.1 win32-x64 node-v12.9.1

@DavidWells
Copy link
Contributor

DavidWells commented Sep 3, 2019

Thanks for the report.

Looks like we are looking for .netlify here https://github.com/netlify/cli/blob/master/src/utils/gitignore.js#L105

./netlify is an unknown pattern we can add that to the check

@XhmikosR
Copy link
Contributor Author

XhmikosR commented Sep 3, 2019

Yeah, I guess you should use a regex there.

@swyxio
Copy link
Contributor

swyxio commented Sep 3, 2019

i would also prefer to be asked before it edits any existing file tbh

@DavidWells
Copy link
Contributor

/.netlify/ will only ignore root .netlify folder.

.netlify will ignore it in parent & in children.

The .netlify folder shouldn't ever be committed into git history as it could contain sensitive information.

Adding .netlify even if /.netlify/ exists, is the intended behavior

Closing this for now.

@XhmikosR
Copy link
Contributor Author

XhmikosR commented Sep 16, 2019 via email

@XhmikosR
Copy link
Contributor Author

XhmikosR commented Sep 16, 2019 via email

@DavidWells
Copy link
Contributor

I hear you @XhmikosR.

We need to protect users who might not understand all the intricacies of how gitignore patterns work and stop them from committing files that could contain sensitive information.

This only runs when netlify init and netlify link are executed. Typically this would happen once per project. You can remove the additional .gitignore line and everything should be okay.

@XhmikosR
Copy link
Contributor Author

XhmikosR commented Sep 16, 2019 via email

@XhmikosR
Copy link
Contributor Author

XhmikosR commented Oct 1, 2019

You guys should seriously reconsider this. I can't be the only one.

Just don't modify files that don't belong to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants