App Academy

Problem with .gitignore file placement


I am having trouble with figuring out why my image in VS Code does not match the screenshot that it is supposed to in the directions for my GIT project. I had completed the project once before, but failed and decided to start over again from scratch, and the fact that the “.gitignore” file shows up above the site.html and below the specimens.jpg line is the problem that I keep running into. Previously, I do not remember having this issue when originally doing the GIT assessment, but I cannot figure out what I’m doing wrong. When it asks us to create a new file in the git-repo-management directory, I selected the button directly to the right of git-repo-management that says add new file and then proceed to name it .gitignore and go from there about typing the .DS_Store in the first line and leaving the second line blank. Any guidance on what I am doing wrong or need to do differently would be greatly appreciated! Thank you!


Learning Challenge


What I’ve tried


That looks correct. You are not suppose to see the .gitignore file in the structure. You are seeing it now because you opened it. When you type “ls” in the terminal to see the files in your directory, it would not pop up because usually you are not meant to touch the file. However if you type
“ls -a” you can see it. For the file structure. If you are on mac, you can type “tree” in the console and it will show the file structure like the second picture. I am not sure how to do it on windows though


^^This is exactly right. You should be seeing the .gitignore file in VSCode at the location you have it in your screenshot, but it will not show up in the terminal when you run ls. You’re on the right track!

1 Like