146

what happens if your .gitignore file contains '.gitignore'?

Comments
  • 8
    😲
  • 54
    The whole things blew up and you get a black hole in your repo 😄
  • 4
    Just don't... Or the earth won't be what it was used to be...
  • 68
    @JonnyCodewalker how dare you give a logical answer!?
  • 10
    You will get a special phone call from Igor Bogdanoff
  • 33
    Linus would show up and says "Stop it. Get some help by deleting your git and start over" 😂
  • 15
    Git ignores the .gitignore file but the contents are still read 🤫
  • 6
    @JonnyCodewalker @C0D4

    I like you 2. 🤔
  • 22
    So how do I push my .gitignore to ignore .gitignore (after adding the rule) ?
  • 6
    @byte oh now I like you more. 🤔
  • 21
    @byte sry but that doesn't work. Even if you are able to push the .gitignore to ignore .gitignore at the very moment when .gitignore is tracked it won't ignore .gitignore anymore. .gitignore can only ignore files that are not tracked. So you can only ignore .gitignore with .gitignore as long as it is not tracked :D
  • 26
    @pain your name matches your comment here
  • 1
    @C0D4 that would mean people can have their own personal .gitignore in the same branch. Must be hell. But I bet some people will see it as a great reason not to work with branches...
  • 1
    It will actually take it as two negatives = a positive so everything you want your git to ignore it doesn't ignore 😉
  • 4
    Gitception?
  • 1
    @byte Just add your .gitignore file with a commit message and 'ggpush' or 'git push --force'
  • 3
    Couldn't you just add it with 'git add .gitignore'. The .gitignore should just specify which files will be ignored on 'git add -A'
  • 1
    @Charmesal yea it’s fun to deal with if someone adds files they shouldn’t be adding.
  • 2
    It gitnores
  • 0
    Eventual heatdeath of the universe
  • 0
    Your code now actually works
  • 0
    The FBI wants to know your location
Add Comment