question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

myhosts and whitelist ignored by .gitignore

See original GitHub issue

The myhosts and whitelist files seem to have been originally created and checked in to the repo, so git doesn’t follow the .gitignore file for those two files. Should those be removed from the cache and recommitted, with instructions on how to create those files if you need them? As it exists now, the README is somewhat confusing, since it states that those files aren’t tracked but they technically still are.

In addition, should the hosts file itself be removed from the cache and added to the .gitignore file as well? As it exists now, if I were to add entries to the myhosts file, they’ll end up getting committed to the base hosts file once it’s created. You could potentially get burned by that and need to purge your fork. I’ve removed the hosts file from my fork to address that, but that now causes merge conflicts every time I pull.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gfyoungcommented, Aug 2, 2018

Proposal (in addition to .gitignore-ing them properly):

  • Rename all of those files to [filename].example.
  • When running the Python update script, if [filename] does not exist in the file directory, copy over [filename].example to [filename]

Thoughts?

cc @StevenBlack

xref: https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore

0reactions
StevenBlackcommented, Aug 2, 2018

@gfyoung I think this is a good idea.

Read more comments on GitHub >

github_iconTop Results From Across the Web

git - .gitignore ignoring whitelisted folder - Stack Overflow
Git tracks files, not directories, but gitignore rules can match files and directories. Try this: # Ignore by default * !.gitignore # Whitelist...
Read more >
Effective .gitignore whitelisting patterns - Jason Stitt
Here are some configuration patterns I've found to be effective. Ignore everything, then add specific subtrees. # Ignore everything * # But ...
Read more >
How to Set Up .gitignore As a Whitelist - How-To Geek
Usually, you want to ignore certain files and folders, but sometimes it's easier to do it the other way around. Using .gitignore as...
Read more >
.gitignore mistake that everyone makes - DEV Community ‍ ‍
gitignore should be a whitelist, not a blacklist of files you want to ... In practice, this means that you ignore all files...
Read more >
How to implement a .gitIgnore whitelist - André R. Ferreira, MSc
1. We begin by making sure we are in possession of the required prerequisites, as such, we check if Git is installed and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found