r/git • • 12d ago

Why is .gitignore not being added

I want my .gitignore file to go with my repository, but it keeps disappearing for some reason. I am sure I added it explicitly at some point, but it's not only gone from the repository but also from the file structure. I am thoroughly confused

Edit, sorry, it didn't disappear, i just failed to see it. It's all as intended, I am just stupid

0 Upvotes

7 comments sorted by

16

u/bikeram 12d ago

Did you .gitignore it??

It should add like any other file. Did you put it in the root of the repo?

14

u/Ill-Exchange-2377 12d ago

I just cloned the repo, and forgot to -a when using ls, and wondered why it didn't copy it over, I should have double checked before coming here

7

u/AKostur 12d ago

Ah, just an oops. That's OK. We've all made silly mistakes.

3

u/FedUp233 12d ago

Really? Personally I’ve never made a single mistake in my entire life! 😁😁

Now if I could just get other people to see it that way.

1

u/edwbuck 6d ago

It happens. Hidden files are often missed, for various reasons.

You can

alias ls="ls -a"

in your command line to always show them, and if you like that, put it in your .bash_profile

5

u/F0tNMC 12d ago

It happens! ls -a will show you everything in your current directory.

2

u/lassevk 11d ago

I am just stupid

We've all been this stupid, don't sweat it :)