Git
Getting a clone of the main repository for a project on flossclass.com (may already be done for you)
To make a "clone" (your own version) of the current project, do this:
(In your home directory on flossclass.com)
git clone /home/floss_projects/project1/
- You have three useful git shortcuts/aliases defined:
- pull - Use this to get the most recent changes (everybody else's changes) from the project.
- done (Syntax: done "some message about what you did") - Do this when you're done coding and are ready to push your changes to the repository (which we all share, which we all push and pull from). You will get the following error message if you don't follow this syntax: "error: switch `m' requires a value"
- push - Use this when you're done (i.e. when you've already executed the done command above) and want to commit your changes.
If you'd like to track changes on github.com and keep them in sync with your individual repository on flossclass.com, you can do this:
( If you haven't forked your own copy of your class's project from http://github.com/flossclass/ then now's a good time to do so by clicking on the project and then clicking on "Fork" )
git remote add github YOUR_CLONE_URL
Then you can push and pull from "github" in addition to "origin", so the commands would be git pull github master and git push github master
If you'd like to work locally on the files (for example, without an internet connection to connect to the SSH drive), then you can install git (if not installed) on your local operating system, then clone your github.com repository like this:
git clone YOUR_CLONE_URL
This will clone your repository and automatically alias it with the name "origin", so you can do the following to sync with your github repository whenever you get an internet connection again:
git pull origin master
git push origin master
Then, if you'd like to work remotely again, in the project directory in your home directory on flossclass.com, just do this to get back in sync:
git pull github master
Relevant links:
http://en.wikipedia.org/wiki/Revision_control
http://en.wikipedia.org/wiki/Branching_(software)
