Difference between revisions of "Cloning (i.e. downloading for the first time)"

From Geos-chem
Jump to: navigation, search
(Cloning Git-backed software other than GEOS-Chem)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
__FORCETOC__
 
__FORCETOC__
'''''[[First-time Git setup|Previous]] | [[Ignoring files|Next]] | [[Guide to using Git with GEOS-Chem]] | [[Getting Started with GEOS-Chem]] | [[Main Page|GEOS-Chem Main Page]]'''''
+
'''''[[First-time Git setup|Previous]] | [[Ignoring files|Next]] | [[Guide to using Git with GEOS-Chem]]'''''
 +
 
 +
#[[Introduction to Git]]
 +
#[[Installing Git]]
 +
#[[First-time Git setup]]
 +
#<span style="color:blue">'''Cloning (i.e. downloading for the first time)'''</span>
 +
#[[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]]
  
  
Line 17: Line 33:
 
To clone the current version of GEOS-Chem, type:
 
To clone the current version of GEOS-Chem, type:
  
  git clone https://github.com/geoschem/geos-chem.git LOCAL_DIR_NAME
+
  git clone https://github.com/geoschem/geos-chem.git LOCAL_CODE_FOLDER
  
where <tt>LOCAL-DIR-NAME</tt> is the name of the local directory on your disk into which the GEOS-Chem source code files will be placed.  It is up to you to pick <tt>LOCAL-DIR-NAME</tt>.
+
where <tt>LOCAL-CODE_FOLDER</tt> is the name of the local directory on your disk into which the GEOS-Chem source code files will be placed.  It is up to you to pick <tt>LOCAL-CODE_FOLDER</tt>.
  
 
The GEOS-Chem source code that you downloaded will be a copy of the '''master''' branch, which always points to the [[GEOS-Chem 12#current stable GEOS-Chem version|current stable GEOS-Chem version]].  (More about Git branches in a couple of chapters.)
 
The GEOS-Chem source code that you downloaded will be a copy of the '''master''' branch, which always points to the [[GEOS-Chem 12#current stable GEOS-Chem version|current stable GEOS-Chem version]].  (More about Git branches in a couple of chapters.)
 +
 +
If you plan on using GEOS-Chem "Classic", you will also need to clone the [[GEOS-Chem Unit Tester]]:
 +
 +
git clone https://github.com/geoschem/geos-chem-unittest.git UT
  
 
== Cloning an older GEOS-Chem version ==
 
== Cloning an older GEOS-Chem version ==
Line 36: Line 56:
 
== Cloning Git-backed software other than GEOS-Chem ==
 
== Cloning Git-backed software other than GEOS-Chem ==
  
You can clone any software that has been saved to a Git repository.  The only thing different that you have to specify is the path to the remote repository (and optionally, the name of the local folder into which the code will be copied.
+
You can clone any software package (not just GEOS-Chem!) that has been saved to a Git repository.  The only thing different that you have to specify is the path to the remote repository, and optionally, the name of the local folder into which the code will be copied.
  
 
Examples:
 
Examples:
Line 51: Line 71:
 
#[https://git-scm.com/book/en/v1/Git-Basics-Getting-a-Git-Repository ''Git basics: Getting a Git repository'' (Pro Git book)]
 
#[https://git-scm.com/book/en/v1/Git-Basics-Getting-a-Git-Repository ''Git basics: Getting a Git repository'' (Pro Git book)]
 
#[https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-clone ''Git clone'' (Atlassian Git tutorial)]
 
#[https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-clone ''Git clone'' (Atlassian Git tutorial)]
 +
  
 
----
 
----
'''''[[First-time Git setup|Previous]] | [[Ignoring files|Next]] | [[Guide to using Git with GEOS-Chem]] | [[Getting Started with GEOS-Chem]] | [[Main Page|GEOS-Chem Main Page]]'''''
+
'''''[[First-time Git setup|Previous]] | [[Ignoring files|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

  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


Overview

On this page, we describe how to download (aka "clone") the GEOS-Chem source code with Git.

Cloning the current GEOS-Chem version

The GEOS-Chem source code repository is available for remote download via Git, from our Github repository:

The first time that you will download a new GEOS-Chem version to your disk space, you must use the git clone command. This will create an exact copy of the GEOS-Chem source code (including the complete version control history) to a folder on your disk.

To clone the current version of GEOS-Chem, type:

git clone https://github.com/geoschem/geos-chem.git LOCAL_CODE_FOLDER

where LOCAL-CODE_FOLDER is the name of the local directory on your disk into which the GEOS-Chem source code files will be placed. It is up to you to pick LOCAL-CODE_FOLDER.

The GEOS-Chem source code that you downloaded will be a copy of the master branch, which always points to the current stable GEOS-Chem version. (More about Git branches in a couple of chapters.)

If you plan on using GEOS-Chem "Classic", you will also need to clone the GEOS-Chem Unit Tester:

git clone https://github.com/geoschem/geos-chem-unittest.git UT

Cloning an older GEOS-Chem version

You can also clone an older GEOS-Chem version by using the -b option with git clone. This will copy the GEOS-Chem source code to your folder, and point the code to the branch or the tag that you specify. (For more information about Git branches and tags, then please see our Viewing the revision history page.

For example, to clone a copy of the GEOS-Chem 12.0.0 code, type:

git clone -b 12.0.0 https://github.com/geoschem/geos-chem.git LOCAL_DIR_NAME 
git checkout 12.0.0

This will download the GEOS-Chem source code and point you to the state of the code corresponding to the GEOS-Chem 12.0.0 release.

Cloning Git-backed software other than GEOS-Chem

You can clone any software package (not just GEOS-Chem!) that has been saved to a Git repository. The only thing different that you have to specify is the path to the remote repository, and optionally, the name of the local folder into which the code will be copied.

Examples:

 git clone https://github.com/geoschem/GEOSChem-python-tutorial.git GEOS-Chem-Python-Tutorial
 git clone https://github.com/geoschem/geos-chem-unittest.git UT
 git clone https://github.com/geoschem/gcpy.git gcpy
 git clone /path/to/someone/elses/code TheirCode
 ... etc

Further reading

  1. The git clone command (Official Git documentation)
  2. Git basics: Getting a Git repository (Pro Git book)
  3. Git clone (Atlassian Git tutorial)



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