I found & forked a GitHub project that I want to use (has both front and back end aspects), and git cloned the project to my local machine.
When I went to access the
.env.example file on my local machine (so I could add in credentials), it wasn’t there. All the files that start with a dot
.nameOfFile simply don’t get brought down to my local machine (see list below).
Can someone please explain to me why this is happening?
How do I get those files onto my local machine, so I can make an
.env file (along with using
.gitignore)? I want to securely add in my credentials on my local machine (combined with using the dotenv package) so my private credentials do not get pushed to my public GitHub repository, but the thing will still work.
Thanks for the help in advance!
It’s because all those files are local to your machine so those are something that you need to create yourself. Some of them will be generated when you install certain npm modules on your local machine. You can make your .env file so is .gitignore file. .gitignore file is key here because you can restrict which files can be pushed out to your remote repository so this is the place enlist confidential data or personal settings.
Are you sure this is actually the case, that the dotfiles aren’t just hidden in whatever you’re viewing them in. There should be no reason why they aren’t there - they are just files like any of the other files.
@DanCouper, you are a life saver!! Thanks so much, that was the exact problem. I thought it might be something stupid and silly…and turns out it was!
I didn’t realize this until now, but by default Macs hide all files that start with
"." hence why I couldn’t see any of those files.
Had to click on my “Macintosh HD” (in the finder window) and press
cmd+shift+. and all hidden files appeared.
Thank you so much!
@shimphillip, thanks for the response as well, but it turns out that these files were indeed on my local machine…just hidden!
I’ve done the exact same thing before as well . I normally set spotlight to always show hidden files now cos I can never remember the keyboard shortcut when I need it - to fix permentantly it’s just a terminal command then a restart, I would Google for that
Thanks. I will check that out as I’ll never remember that keyboard shortcut either! Haha