‹ BackHN Continuity

Thread

Two Git ignore files nobody told me about

95 points · 66 comments · faithraven

  1. ktm5j · · focus · HN ↗
    Just a nit-pick, but some/repo/path/.gitignore isn't necessarily committed to the repo. For example, if your repo has no .gitignore file, you can totally add one in your clone without adding it to the tree. Of course then you can't do something like `git add .` without committing it.

    Also `~/.gitignore` works as a global gitignore. I usually stick something like `katie*` in there so I can copy some `script.sh` to `katie_script.sh` and then I can make changes that I don't want to commit.

    Quick edit: I'm not sure `~/.gitignore` works out of the box.. looks like I stuck that in my `~/.gitconfig` for excludesfile

    1. crtasm · · focus · HN ↗
      Out of the box you can use ~/.config/git/ignore and ~/.config/git/config
      1. ktm5j · · focus · HN ↗
        I have no ~/.config/git directory, ~/.config/git/config might take higher precedence, but ~/.gitconfig works too.
        1. crtasm · · focus · HN ↗
          Yes you may have to create the directory :)
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.