Ignoring files
Table of contents
ignoring files
Given a situation:
$ touch thisShouldNotBeInGit.txt
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# thisShouldNotBeInGit.txt
nothing added to commit but untracked files present (use "git add" to track)
This is easy way to fix it:
$ echo thisShouldNotBeInGit.txt >> .gitignore
$ cat .gitignore # -->read the contents of .gitignore
.gitignore
_site
thisShouldNotBeInGit.txt