Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to edit gitignore file

I started TheOdinProject on Ubuntu 18.4 and in the Git section it tells me to edit the .gitignore file. I already created it using touch .gitignore and it is showing up when i type ls -la but I don't see it in Files. In the video https://www.youtube.com/watch?v=HVsySz-h9r4 that is referenced the file is already open and there isn't an explanation on how to open it. How do I open the .gitignore file from Terminal in order to add something like .DS_Store in it?

like image 673
leonbeckert Avatar asked Apr 05 '20 15:04

leonbeckert


Video Answer


2 Answers

.gitignore files are hidden on *nix operating systems because of their dot prefix (link). However you can access them as normal from the shell. e.g. nano .gitignore.

like image 135
simon-pearson Avatar answered Oct 06 '22 18:10

simon-pearson


ls -lah (the h flag is for hidden files)

You can open and edit it with any terminal text editor (or GUI code text editor)

like image 1
symlink Avatar answered Oct 06 '22 18:10

symlink