Page MenuHomec4science

Updated 1,338 Days AgoPublic

Version 1 of 3: You are viewing an older version of this document, as it appeared on Jan 29 2018, 12:58.

To avoid adding and commiting unwanted files to your repository (for example generated machine code, or temporary files) you can use the .gitignore file.

Create this file in any directory of your repository and add the file to the repository.

echo "*.png" >> .gitignore
git add .gitignore
git commit -m "Ignore all PNG files"

In this file you will give a list of files you want git to ignore. If the files are already part of the git history, it will ignore new changes to the file and if it's not tracked it will ignore it alltogether (unless you specifically add it with git add myfile).

Each line of the gitignore file can contain either a file name, a full path to a file, a directory or a pattern. Here are some examples:


Finally you can find here a list of gitignore example and templates:

Last Author
Last Edited
Jan 29 2018, 12:58

Event Timeline

aubort created this document.Jan 29 2018, 12:58
aubort edited the content of this document. (Show Details)
aubort added a project: c4science.
aubort edited the content of this document. (Show Details)
aubort edited the content of this document. (Show Details)Jul 2 2018, 16:11