Skip to content
Alfatih Ali edited this page Dec 19, 2017 · 31 revisions

Download NERSC-HYCOM with git from Github:

$git clone https://github.com/nansencenter/NERSC-HYCOM-CICE.git

## How to track and update the 'develop' in GitHub from your local dir:

  • To show all local and remote branches, your active branch is marked with *:

$ git branch -a

  • To show only all remote branches:

$ git branch -r

  • To show what your 'origin' is pointing at:

$ git remote -v

  • To track changes 'develop' branch in your local dir:

$ git checkout --track origin/develop

  • To switch to the 'develp' branch in your local dir:

$ git checkout develop

  • To update your local develop branch from the Github develop branch

$ git pull origin develop

>> Merging for example 'nesting' or 'Fram' in 'develop' branch and push it to the Github:

  1. first switch to 'develop'

$ git checkout develop

You can verify this by running '$git branch -a' and you will see a * pointing to 'develop' on the list 2. Now run merge command

$ git merge --no-ff nesting

This will update 'develop' with all new changes in 'nesting' in you local dir: If there are some conflicts in some files, then you have to resolve them by opening these files one by one, see here https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/.

  1. Now check status add and commit $ git check status

$ git add .

$ git commit -m ‘nesting is now merged to develop’ # record changes in the new branch

To pull updates the corresponding 'develop' branch in Github:

$ git push origin develop

# * General command Creating a new branch/edit and commit in your local dir and merge with develop branch:

  • create a new branch

$ git branch featue1

  • switch to the new branch

$ git checkout feature1

>> Now you edit files and make change, then add and commit:

$ git add .

  • record changes in the new branch

$ git commit -m ‘add test’

  • compare with the develop branch

$ git diff develop

  • switch back to the develop branch to be your active branch

$git checkout develop

  • merge feature1

$git merge --no-ff feature1