You can ignore specific files in Git by placing a .gitignore file at the root of your local repository. The files listed in .gitignore will not be tracked by Git. Why would you do this? Well, there are certain OS generated files placed in system folders such as .DS_Store or Thumbs.db that are not really part of your code.

Create a .gitignore file

<pre lang="html">
touch .gitignore

Edit the .gitignore file

<pre lang="html">
sudo nano .gitignore

Add the files you want excluded. You can use wildcards.

<pre lang="html">

Commit and Push

<pre lang="html">
git commit -m "adding .gitignore file" -a
git push

That should do it!