Ignoring files: Difference between revisions
(Created page with "__FORCETOC__ '''''Previous | [[|Next]] | Guide to using Git with GEOS-Chem | Getting Started with GEOS-Chem | Main...") |
No edit summary |
||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
__FORCETOC__ | __FORCETOC__ | ||
'''''[[Cloning (i.e. downloading for the first time)|Previous]] | [[Next]] | [[Guide to using Git with GEOS-Chem]] | '''''[[Cloning (i.e. downloading for the first time)|Previous]] | [[Viewing the revision history|Next]] | [[Guide to using Git with GEOS-Chem]]''''' | ||
#[[Introduction to Git]] | |||
#[[Installing Git]] | |||
#[[First-time Git setup]] | |||
#[[Cloning (i.e. downloading for the first time)]] | |||
#<span style="color:blue">'''Ignoring files'''</span> | |||
#[[Viewing the revision history]] | |||
#[[Using Git GUI]] | |||
#[[Branching]] | |||
#[[Committing]] | |||
#[[Tagging]] | |||
#[[Merging]] | |||
#[[Receiving updates (aka pulling)]] | |||
#[[Using patches to share your updates with others]] | |||
#[[Advanced Git usage]] | |||
#[[Git and Github tutorials]] | |||
== Overview == | == Overview == | ||
Line 22: | Line 39: | ||
ls -a .gitignore | ls -a .gitignore | ||
== The .gitignore files used | == The .gitignore files used by GEOS-Chem == | ||
Here is what the <tt>.gitignore</tt> files that are found in each GEOS-Chem source code subfolder look like. You can of course edit these for your own purposes: | Here is what the <tt>.gitignore</tt> files that are found in each GEOS-Chem source code subfolder look like. You can of course edit these for your own purposes: | ||
Line 56: | Line 73: | ||
#[https://www.atlassian.com/git/tutorials/saving-changes/gitignore ''Gitignore'' (Atlassian documentation)] | #[https://www.atlassian.com/git/tutorials/saving-changes/gitignore ''Gitignore'' (Atlassian documentation)] | ||
#[https://help.github.com/en/articles/ignoring-files ''Ignoring files'' (Github help)] | #[https://help.github.com/en/articles/ignoring-files ''Ignoring files'' (Github help)] | ||
---- | ---- | ||
'''''[[Cloning (i.e. downloading for the first time)|Previous]] | [[Next]] | [[Guide to using Git with GEOS-Chem | '''''[[Cloning (i.e. downloading for the first time)|Previous]] | [[Viewing the revision history|Next]] | [[Guide to using Git with GEOS-Chem]]''''' |
Latest revision as of 20:26, 5 August 2019
Previous | Next | Guide to using Git with GEOS-Chem
- Introduction to Git
- Installing Git
- First-time Git setup
- Cloning (i.e. downloading for the first time)
- Ignoring files
- Viewing the revision history
- Using Git GUI
- Branching
- Committing
- Tagging
- Merging
- Receiving updates (aka pulling)
- Using patches to share your updates with others
- Advanced Git usage
- Git and Github tutorials
Overview
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:
*.[oax] *.mod *.MOD *~* *.swp *.bak *.patch *.diff geos geostomas geosapm diffs bak misc test GCHP GIGC *.pp.* *.pdb *.inst.* *.continue.* *.ppk *.log bin/*
Further reading
- The .gitignore file (Official Git documentation)
- Gitignore (Atlassian documentation)
- Ignoring files (Github help)