Add File to Git Ignore with Nano Text Editor on Mac - VicPhanDevOps/mac GitHub Wiki

• Type git status and press the return key to see the file you wish to ignore.
image

• Type nano .gitignore and press the return key to open the .gitignore file in the Nano text editor.
image

• Press the down arrow until the cursor is at the bottom of the file.
image

• Press the return key to create a new line, type # ignore < filename > and press the return key to comment which file to ignore.
image

• Type < filename > and press the return key, then press the control and X keys to exit the text editor.
image

• Press the Y key to save changes.
image

• Press the return key to save the file with the same filename.
image

• Type clear and press the return key to clear the Terminal.
image

• Type git status and press the return key and the file will no longer appear.
image

⚠️ **GitHub.com Fallback** ⚠️