X Tutup
The Wayback Machine - https://web.archive.org/web/20210210103937/https://github.com/github/gitignore/pull/3601
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

added #self .gitignore in Python #3601

Closed
wants to merge 1 commit into from
Closed

added #self .gitignore in Python #3601

wants to merge 1 commit into from

Conversation

@aa-ag
Copy link

@aa-ag aa-ag commented Dec 19, 2020

Reasons for making this change:

It's something I find myself doing over and over and over. Hopefully, it helps others.

Links to documentation supporting these rule changes:

N/A.

If this is a new template:

N/A.

@aa-ag aa-ag closed this Dec 20, 2020
@aa-ag aa-ag reopened this Dec 20, 2020
@magnusbaeck
Copy link

@magnusbaeck magnusbaeck commented Dec 22, 2020

It's something I find myself doing over and over and over.

Okay, but why are you adding a .gitignore entry to the .gitignore file?

@aa-ag
Copy link
Author

@aa-ag aa-ag commented Dec 23, 2020

I was looking @ https://stackoverflow.com/questions/767147/how-can-i-stop-gitignore-from-appearing-in-the-list-of-untracked-files and it seems like it is best practice to leave it out. However, I usually end up with a ton of junk files / cached stuff from my IDE.

Would it be better to add this instead?

# VS Code
.vscode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
@drothmaler
Copy link
Contributor

@drothmaler drothmaler commented Dec 23, 2020

As the top answer (with 900+ Upvotes) in your cited SO question states:

The .gitignore file should be in your repository, so it should indeed be added and committed in, as git status suggests. It has to be a part of the repository tree, so that changes to it can be merged and so on.

So adding itself to a .gitignore file makes no sense at all.
If you really want to ignore some files only locally, you should either put them in the .git/info/exclude file in your project, or place them into your global gitignore:
https://docs.github.com/en/free-pro-team@latest/github/using-git/ignoring-files#configuring-ignored-files-for-all-repositories-on-your-computer
(Thats what I do for stuff like OS-specific files, VSCode, Office temp files, archives and other things).

@aa-ag
Copy link
Author

@aa-ag aa-ag commented Dec 23, 2020

Sounds good.

@aa-ag aa-ag closed this Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
X Tutup