Ignoring files

From Geos-chem
Jump to: navigation, search

Previous | Next | Guide to using Git with GEOS-Chem

  1. Introduction to Git
  2. Installing Git
  3. First-time Git setup
  4. Cloning (i.e. downloading for the first time)
  5. Ignoring files
  6. Viewing the revision history
  7. Using Git GUI
  8. Branching
  9. Committing
  10. Tagging
  11. Merging
  12. Receiving updates (aka pulling)
  13. Using patches to share your updates with others
  14. Advanced Git usage
  15. Git and Github tutorials


On this page, we provide information on how you can tell Git to ignore certain types of files that should not be included in the version control.

Excluding files from the Git version history

Git also allows you to ignore certain types of files that we don't need to track (e.g. anything that can be built from the source code). These typically include:

  • Object files (*.o)
  • Library files (*.a)
  • Module files (*.mod)
  • Autosave files (*~)
  • Executable files (geos, geostomas)

To exclude these types of files, you must create a .gitignore file. This is a text file containing the files (or file types, using the * wildcard) that you do not wish Git to track. Each folder in a Git source code repository must have its own .gitignore file. For most purposes, you can copy the same .gitignore file to each subfolder.

To check if a source code folder has a .gitignore file, type:

ls -a .gitignore

The .gitignore files used by GEOS-Chem

Here is what the .gitignore files that are found in each GEOS-Chem source code subfolder look like. You can of course edit these for your own purposes:


Further reading

  1. The .gitignore file (Official Git documentation)
  2. Gitignore (Atlassian documentation)
  3. Ignoring files (Github help)

Previous | Next | Guide to using Git with GEOS-Chem