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

.gitignore: Remove cruft and editor/OS-specific ignore files #21458

kevinburke opened this issue Aug 15, 2017 · 5 comments

.gitignore: Remove cruft and editor/OS-specific ignore files #21458

kevinburke opened this issue Aug 15, 2017 · 5 comments


Copy link

@kevinburke kevinburke commented Aug 15, 2017

Here's the current contents of the .gitignore file for the Go project.



# IntelliJ-based editors

Many of those, like .idea and .DS_Store, are not specific to the Go project - they're specific to a user's environment or to an OS. There are large number of user-specific files that get placed in directories that we might need to exclude; we can't enumerate the list, and it also seems useful to teach users how to solve this problem for themselves.

Git has a tool for dealing with files you'd like to (privately) ignore. You can edit the .git/info/exclude file to privately ignore any files you don't want to commit to the project. You can also create a global .gitignore file for your computer to ignore those files in every Git repository on your machine, described here:

Finally, you can create a Git template to automatically populate the contents of .gitignore whenever a new Git repository is created, as described here:

I'd like to propose that we put the above instructions in the .gitignore file and then remove all of the user and OS-specific ignore directives; the ignore file should only include artifacts that are generated by the Go project that we'd rather not check in.

Copy link

@jessfraz jessfraz commented Aug 15, 2017

seems sane to me to keep only the repo specific ones

Copy link

@martisch martisch commented Aug 15, 2017

If .DS_Store will be removed i think .nfs.* , *.swp would fall into the removal category of os/env specific files too.

Copy link

@gopherbot gopherbot commented Aug 15, 2017

Change mentions this issue: .gitignore: include only Go project artifiacts

gopherbot pushed a commit that referenced this issue Aug 15, 2017
This effectively reverts

and adds a guide on what not to add in this file.

Update #21458

Change-Id: I7c740d492b70628b5d9f9e1622014995a3f6f8ec
Reviewed-by: Ian Lance Taylor <>
Copy link

@ianlancetaylor ianlancetaylor commented Mar 30, 2018

Is there anything else to do here?

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Mar 30, 2018
Copy link

@agnivade agnivade commented Aug 15, 2018

We still have .DS_Store which @kevinburke wanted to remove.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants