This article covers how to ignore and untrack files and directories with Git.
Inside your project root directory, where your repository has been initialized,
create a file called
.gitignore or edit a pre-existing
Within this file you can add file paths or directory paths that you don't want git
If you are lazy and don't want to run
vim to edit the file you can run the
echo ":path_to_ignore" >> .gitignore
It will prepend
:path_to_ignore to the existing
Sometimes you may want to stop tracking.
.gitignorefile as mentioned above.
git rm --cached :path_to_untrack
:path_to_untrack is the path of the file or directory you want to
Once you have told git to stop tracking the file, you must commit.
git add .gitignore git commit -m "Ignoring..."
Like this article? Found it useful?
Share it on your favorite social networks.