Missing .gitignore from HOMEFOLDER/github folder


#1

I made the mistake of trying to move the package I was creating from the Mac default location of the /github folder in the home folder to my personal coding folder (organization freak). I was unsuccessful in my attempt to do this, but I also in inadvertently deleted a .gitignore file that was in the folder that I was unaware of, so now I’m getting this message when I open Atom: “Project directory HOMEFOLDER/gitignore is no longer on disk.” Anyway of getting the gitignore back? I attempted to create a new package to see if Atom would stick a new .gitignore in there, but it didn’t work. Anyone have any suggestions? Also, any suggestions for moving the atom package to a different folder would be great also, as I don’t really like having coding projects in multiple locations.

Thanks.


#2

.gitignore is just a plain-text file that contains a list of patterns to ignore and you can create a new one just like you’d create any other file. The default .gitignore for Atom packages is short and sweet:

.DS_Store
npm-debug.log
node_modules

#3

Thanks DS! Yeah I’m very familiar with gitignore files, I just had no idea what this particular one contained. Appreciate you telling me what is included. I’ll make my own. Thanks buddy.


#4

Hmmmm, I’ve created the .gitignore file and loaded it with the items you mentioned, but Atom is still sending the message that it is missing. Any suggestions or tips?


#5

I’ve never seen the message you quote. It also doesn’t seem to make much sense. When Atom says “project directory”, it means the set of top-level directories in the tree view for that window. Why would there be a project directory called gitignore? If Atom thinks that it ought to open one and isn’t able to, that could maybe cause it.

Do you get this message if you open a different folder in Atom, via the context menu or the command line?


#6

D’oh! Man, my silliness boggles myself sometimes. A week ago, I downloaded the gitignore repo, and deleted it shortly after opening it in Atom. I haven’t had a need to use Atom in a week or so and haven’t opened it since deleting the project, so when I opened it, it tried to open the deleted project folder and couldn’t do it. I totally forgot about the fact I downloaded that repo and was instantly thinking of an actual .gitignore file that might’ve been missing.

So yeah, turns out it was trying to load a folder I deleted and I had forgot. Ultimate stupidity over here.

Thanks for the help.


#7

Now everything makes perfect sense. Glad I could help. :slight_smile:


#8

Just curious DS, where is the .gitignore file located that you mentioned above? The one with:

.DS_Store
npm-debug.log
node_modules

What directory should this be placed in on the macOS system?


#9

Each git repo will have its own .gitignore file. I don’t think they have any meaning outside of repos. That’s the auto-generated file from a package project I’m working on.


#10

Ok, so it is just a package .gitignore file. Go it. Thanks again.