View hidden folders on MacOS Mojave? cmd+shift+. does not work
There are two types of hidden items (files or folders) on macOS:

Those which start with . whose hidden bit it set by default.
Those with no starting ., but chflags set to hidden. Run man chflags to see more info.


I clicked it and saw many folders in Library, but still didn't see any folders with . in front

Those folders are of the second type.

However, I cannot show my hidden folders.

Let's see if there's a problem with hidden files itself. In Terminal, run :
cd ~/Downloads
mkdir test_hidden &amp;&amp; cd test_hidden
touch empty
touch .empty_h
open .

In this folder that opens, do you see files (dis)appearing if you toggle command+shift+. ?
Update: Restarting and running killall Finder helped.
For the .gitignore file, use ls -a command to list all items in a directory. If there is a .gitignore file there, you can run
open .gitgignore

to open it with default text editor. Or nano .gitignore. Or specify a text editor:

Can I open files in TextEdit from the Terminal in Mac OS X?