Log In | Users | Register
Edit | Attach | New | Raw | Diff | Print | | Tools
You are here: Data » DocTools » ToolsCtrl » Git

Git

Git is a collaborative revision control system. COSMO and the related codes currently hosted by C2SM were migrated from Subversion to git on December 7th, 2015.

Migration from Subversion to git

The contents of the two COSMO Subversion repositories were migrated to the Github web hosting site. The main development trunks for each code were migrated by C2SM, while users are responsible for migration of their own personal development branches. Details about the new code repositories on Github and the user migration can be found in the following files:

git subtree

In order to embed one git repository into another one (for example like the testsuite is embedded into multiple cosmo codes), it is recommended to use git subtree. The following steps can be followed to first add a nested repository (repo2 to repo1), and then to update the nested repository.

First, to add repo2 to repo1:

  1. Clone repo1 from Github and cd into the top directory: git clone git@github.com:path/to/repo1; cd repo1
  2. Use git subtree add to add repo2 to repo1: git subtree add --prefix path/to/repo2 git@github.com:repo2/github/path master --squash
To update the repo2 repository inside repo1 when new commits have been made, the git subtree pull command is used as follows:
  1. Clone repo1 from Github and cd into the top directory: git clone git@github.com:path/to/repo1; cd repo1
  2. Add repo2 as a remote: git remote add -f repo2 git@github.com:repo2/github/path
  3. Update repo2: git subtree pull --prefix path/to/repo2 repo2 master --squash

Resources

There are many resources available to help with learning to use git and Github. Some useful ones include: spacer
This site is managed by the Center for Climate Systems Modeling (C2SM).
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems? Send feedback!