Show system files / Show git ignore in osx

By default, it is not possible to see .gitignore files in osx. What is the command to open these files?

+62
git macos
Jun 25 2018-12-12T00:
source share
11 answers

Open a terminal and enter

  • on OS X 10.8:

    defaults write com.apple.Finder AppleShowAllFiles TRUE 
  • on OS X 10.9:

     defaults write com.apple.Finder AppleShowAllFiles TRUE 

Then you must restart finder:

 killall Finder 

Any file name in OS X prefixed with '.' considered "hidden."

+130
Jun 25 2018-12-12T00:
source share

βŒ˜β‡§. will toggle the setting of AppleShowAllFiles .

This key combination will work from open / saved dialogs in all applications, not just search. Use this and you will never be embarrassed when elses on someone's Mac or a new Mac, and you can avoid being fooled by defaults write .

I use the "use point to display point file" nonmonics to remember it, due to hidden point files in unix.

+21
Jul 10 '17 at 18:29
source share

If you just want to look at them, you can always use the command line:

ls -al path/to/dir

If you want to always browse all files from a search engine, you can:

defaults write com.apple.Finder AppleShowAllFiles YES

If you just want to browse the .gitignore with the crawler, you can:

chflags nohidden /path/to/dir/.gitignore

But you will have to call this command on every .gitignore it is not global.

+15
Jun 25 '12 at 21:00
source share

(later, for 10.10.2 :)

The above commands did not work for me. I am using OSX Yosemite: 10.10.2. This worked:

 defaults write com.apple.finder AppleShowAllFiles -boolean true; killall Finder; 

Source: http://www.idownloadblog.com/2014/08/04/how-to-show-hidden-files-folders-finder-mac/

+15
Mar 23 '15 at 20:10
source share

You can edit the hidden file in the terminal using this command

 open -a TextEdit .gitignore 
+5
Dec 12 '17 at 23:56 on
source share

You can use the shortcut in Finder:

Command + Shift + .

It will show hidden files. To hide the files again, use the same shortcut.

+4
Dec 19 '18 at 15:48
source share

If you just want to view .gitignore from the console, just type "nano .gitignore" in this directory. This nano command simply opens any text file in the nano console environment for viewing or editing.

+2
Mar 06 '16 at 12:08
source share

In addition to the accepted answer, you can create an alias to easily show / hide hidden files in the terminal. Here's how I set it up (tested / works on macOS Mojave 10.14.1).

In my user directory, I created a new .custom_aliases file and wrote this in:

 # Show/hide files alias showall='defaults write com.apple.finder AppleShowAllFiles -boolean true; killall Finder' alias hideall='defaults write com.apple.finder AppleShowAllFiles -boolean false; killall Finder' 

Then I opened .bash-profile (it should also be in your user directory, if not just creating it there) and added this to the top of the file:

 # Load custom aliases source ~/.custom_aliases 

And this is it! Now that I need to view hidden files, I just showall in Terminal and hideall when I hideall . You can also define aliases directly in .bash_profile , but I have some other things, so I like to keep all the aliases together in a separate file.

+1
Apr 6 '19 at 13:48
source share

To view a hidden file on your iMac or MacBook in Finder, simply press this key combination.

Command (⌘) + Shift (⇧) + .

If you want to hide these files, click the same combination again.

0
Apr 6 '19 at 13:59 on
source share

Show hide file and folder on MacOs Mojave 10.14.4

Submit an application in the terminal

 defaults write com.apple.finder AppleShowAllFiles -boolean true; killall Finder; 
0
May 9, '19 at 10:50
source share

Perhaps you may not have a .gitignore file. If you do not have it, you can create it like this:

 >touch ~/.gitignore 

And then edit it, whatever you want. Git will automatically check this file without additional configuration!

-four
Feb 13 '13 at 20:02
source share



All Articles