Difference between revisions of "Receiving updates (aka pulling)"

From Geos-chem
Jump to: navigation, search
(Getting updates from the GEOS-Chem repository on Github)
(Getting updates from the GEOS-Chem repository on Github)
Line 9: Line 9:
 
When a new GEOS-Chem version is released, we recommend that you [[#Downloading a new GEOS-Chem version|download it from our GEOS-Chem Github repository]] into a new source code folder in your disk space.
 
When a new GEOS-Chem version is released, we recommend that you [[#Downloading a new GEOS-Chem version|download it from our GEOS-Chem Github repository]] into a new source code folder in your disk space.
  
However, there may be times when we release patches or minor versions in order to fix issues in an existing GEOS-Chem version.  If you already have an existing GEOS-Chem source code directory, you can receive these updates by using the '''git pull'' command.
+
However, there may be times when patches and/or minor GEOS-Chem versions are released.  These are typically done in order to fix issues in an prior GEOS-Chem version.  If you already have an existing GEOS-Chem source code directory, you can receive these updates into your source code folder by using the '''git pull'' command, as described below.
  
 
=== Get all updated branches and tags from the GEOS-Chem remote repository ===
 
=== Get all updated branches and tags from the GEOS-Chem remote repository ===

Revision as of 14:44, 21 June 2019

Previous | Next | Guide to using Git with GEOS-Chem | Getting Started with GEOS-Chem | GEOS-Chem Main Page

Overview

On this page, we provide information about how you can get "pull" updates from the GEOS-Chem repository, or any other Git repository.

Getting updates from the GEOS-Chem repository on Github

When a new GEOS-Chem version is released, we recommend that you download it from our GEOS-Chem Github repository into a new source code folder in your disk space.

However, there may be times when patches and/or minor GEOS-Chem versions are released. These are typically done in order to fix issues in an prior GEOS-Chem version. If you already have an existing GEOS-Chem source code directory, you can receive these updates into your source code folder by using the 'git pull command, as described below.

Get all updated branches and tags from the GEOS-Chem remote repository

1. Change to your local copy of the GEOS-Chem code directory, e.g.

cd /path/to/my/GEOS-Chem/Code

2. View the revision history. Your plot will look something like this.

GitPullStep1.png

In this example, the master branch is checked out, which corresponds to GEOS-Chem version 12.3.2.

3. Let's say that you need to add a new feature off of one of the development branches. Pull all remote branch references into your local directory by typing:

git pull

4. View the revision history again. You should now see something like this:

GitPullStep2.png

Note that several pointers to remote branches (beginning with remotes/origin) have been added to your repository. These remote branch references "point" to branches that are present at the GEOS-Chem remote repository on Github. However, you cannot use any of these branches in your local code directory until you create local branches for them.

5. Let's say that you need to work off the dev/12.4.0 branch. Create a local branch for dev/12.4.0 in your code directory. Type:

git checkout dev/12.4.0

You will see this text printed at the command line:

git checkout dev/12.4.0
Checking out files: 100% (173/173), done.
Branch 'dev/12.4.0' set up to track remote branch 'dev/12.4.0' from 'origin'.
Switched to a new branch 'dev/12.4.0'

6. View the revision history again. Now you will see that you have a dev/12.4.0 local branch—which is current with the state of the code at the remote repository—checked out.

GitPullStep3.png

7. Create a new branch off of dev/12.4.0 and start adding your code updates there.

Getting updates from the GEOS-Chem repository in to a particular branch

In the previous example, we pulled all of the


2. Create a new branch


  1. Make a new branch named patch (or something similar).
  2. Check out the patch branch. Now we are ready to obtain the updates from the remote server.
  3. Use the git pull command to download the updated files. Type:
      git pull origin master
  1. Try compiling GEOS-Chem and running for few time steps to make sure everything is fine.
  2. Check out the master branch.
  3. Merge the patch branch into your master branch.
  4. Delete the patch branch.

This will merge the changes from the master branch of the remote repository into your master branch.



Previous | Next | Guide to using Git with GEOS-Chem | Getting Started with GEOS-Chem | GEOS-Chem Main Page