Coastal Ocean Modeling Tools
LiveOcean Architecture Notes


Getting Code Libraries (Git version)

All the code repositories I use are available through GitHub, from here: https://github.com/parkermac. Just click on one of the repository names (like alpha) and then copy the URL using the "HTTPS Clone URL" box on the right.

Then, working from the command line in whatever directory you want the code to end up in (e.g. .../tools/), just type:

git clone [the URL you copied, e.g. https://github.com/parkermac/alpha.git]

NOTES:

  • You need to have git on your machine.
    • I had David Darr update ours on fjord recently. To get it to work I had to add the path to my .bash_profile, with this line (and then log back in):
    • PATH=$PATH:$HOME/bin:/usr/local/git/bin
    • On my Mac I installed the Xcode command line git tools.
    • On my Mac I also installed GitHub for Mac, from here https://mac.github.com/
    • And on GitHub https://github.com/ I created my own account (parkermac)
  • To add an existing code project of your own to local version control, using GitHub for Mac:
    • click the + thingy on the upper left, and select “Add” instead of “Create"
    • then choose the folder, and do “Add Repository"
    • then add Summary and Description comments and “Commit to Master"
    • then “Publish” - so now it is in GitHub, and can be cloned as described above.
  • GitHub repos are PUBLIC, so anyone can get them. To make it private you have to pay.
  • If your project is already in version control using Mercurial, try this to keep your change history intact:
    1. cd ~
    2. git clone git://repo.or.cz/fast-export.git
    3. sudo easy_install -U mercurial
    4. cd [dir where git_repo will sit]
    5. git init [git_repo]
    6. cd [git_repo] (it will be empty)
    7. ~/fast-export/hg-fast-export.sh -r [path to hg repo]
    8. git checkout HEAD
  • and only steps 4-8 would be required the next time
  • Ignoring files in Git:
  • There are many simple git commands to manipulate things from the command line. Try "git help" to see them.

 


Parker MacCready 09/18/2015