4 ms·
Fair point but outside of the context of demonstrating this... _why would you actually ever `echo .gitignore > .gitignore`?_ Seems a bit like pointing out that
by eckza 4y ago
Fair point but outside of the context of demonstrating this... _why would you actually ever `echo .gitignore > .gitignore`?_
Seems a bit like pointing out that running `sudo rm -rfv /` will let you watch your shell eat your whole system a file at a time.
I could be wildly wrong here, though, and I'm interested in some clarification.
- acatton 4y agoThat's my point, that `echo .gitignore > .gitginore` as advertised as "a cool hack" in the article can lead to disasters.
- 58x14 4y agoI can't see how you'd interpret this as "advertising a cool hack." The entire original article: I initialised a new Git repository, and added a .gitignore file instructing git to ignore .gitignore: git init . echo ".gitignore" > .gitignore git status And the result: On branch trunk No commits yet nothing to commit (create/copy files and use "git add" to track) Therefore, we can see Git ignores .gitignore because its in .gitignore, which means it didn’t ignore .gitignore for instructions. Is any of this informative, surprising, or useful? … Absolutely.