python /afs/csail.mit.edu/proj/courses/6.170/repos/create_repo.py
git clone ssh://MY_USERNAME@athena.dialup.mit.edu/afs/csail.mit.edu/proj/courses/6.170/repos/MY_USERNAME.git 6170_code cd 6170_code git remote add handoutcode ssh://MY_USERNAME@athena.dialup.mit.edu/afs/csail.mit.edu/proj/courses/6.170/repos/handoutcode.git git checkout dev git pull handoutcode masterYou should be prompted for a password twice, once after the first command ("git clone") and once after the last command ("git pull"), where you'll have to enter your athena password. As a check to make sure you can submit your code, go ahead and add a special message in the README file and then run
git push origin dev:submit
git pull handoutcode masterto make sure you have the most up to date handout code for the assignment. Be sure that you're in your "dev" branch when you pull.
git pushWhen your work is in such a state that you wish to submit it, issue the following command:
git push origin dev:submitYou can do this as many times as you want before the deadline for each assignment. We will fetch the last commit before the deadline for grading. (Still, we don't guarantee that we won't use a slightly later commit, so don't push a commit that breaks your code right after the deadline either). Note that you might get your repository into a weird state where it complains about the push not being a "fast-forward" commit, or similar. In this case, you have to force git to comply by using
git push origin +dev:submit
git statusUsed all the time, to see a list of files changed since the last commit, and which of these changes are staged for inclusion in the next commit.
git diff <file>See the changes you have made to files or a particular file since the last commit. Typically you run "git diff" for each file with unstaged changes to review your changes before adding it with "git add", then finally when you have reviewed all files you do "git commit".
git add <file>Used to stage the changes in a modified file for inclusion in the next commit, or to add a file that has never been checked in before so that it is included on the next commit.
git reset <file>The opposite of "git add"--the changes to this file will not be included in the next commit after all (unless the file is added with "git add" again).
git checkout <file>Revert the changes made to the specified file, replacing it with the latest version from the repository. Similar to SVN's "revert". Warning: this will erase you changes to that file! Note: The same command is also used to switch between branches.
git commit -m "Commit message."Commit the changes you staged with "git add" to the current branch (often the "master" branch is the only one) of your local repository.
git logShows all the commits in your local repository (to this branch), with their commit messages and authors.
git branch -aShows all the branches in the repository, both local and remote, with an astrick denoting the current branch
git checkout <branch>Switch to the specified branch.
git pullRetrieve (and merge) the latest updates from the remote repository from which the local repository was cloned.
git pushPush the latest series of commits from the current repository to the remote repository from which it was cloned.