C212 Silo/Git FAq

To help understand what is going on, here is a little diagram.
There are three systems we need to understand:
(Your computer refers to your personal computer or a lab computer)


 your                       silo                         git
computer
________                  ________                     ________
|      |   -> Putty  ->   |      |  <- git start <-    |      |
|      |                  |      |                     |      |
|      |   <- winscp ->   |      |  -> git submit ->   |      |
|______|                  |______|                     |______|


Putty: Allows us to connect TO silo, run commands, edit files.
Winscp: Allows us to copy files to silo from our computer or from silo to our computer.

git start: This command when we run it on silo will grab the latest homework/lab files from git and place them in the folders in silo. All of these files will be located under the 
~/$USER-submissions folder.

git submit: This command when we run it on silo will submit all the files in the 
~/$USER-submissions folder to git. This will ensure that the graders can access your work.





These commands are your friends:

pwd: print working directory- it tell you what folder you are currently inside of

ls: Lists all the files and folders in your current folder
ls -l: Lists all the details of all the files and folders in your current folder

cd <FOLDER NAME>: change directory, if you do "cd labs" for instance that will let you move into the labs folder (assuming there is one)

cd ..  :    This command is special, it means you go up one folder instead of into one.

pico -w <FILENAME>: This lets you edit your file or make a new file.


javac Test.java:  compiles the Test.java file and generates .class files

java Test: Runs a Test.class file in the current folder if there is one.









Frequent Problems:

1. When I run "git start" or "git submit" I get the error:

fatal: Not a git repository (or any of the parent directories): '.git'


You are not in the correct folder to run a git command. Try copying and pasting this exact command:

cd ~/$USER-submissions
git start
git submit


PLEASE note that $USER is actually a variable here that will be replaced by your username. You can see this by running:

echo $USER

Hence when you run
cd ~/$USER-submissions

It is actually doing something like this:
cd ~/jasoyode-submissions



2. When I run "git submit" the following happens:


[jasoyode@silo jasoyode-submissions]$ git submit
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)


Try running the following command:

git push origin master



3. When I try to run git submit the following happens:

error: failed to push some refs to 'git@github.iu.edu:SP2014C212/jasoyode-submissions.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge remote changes before pushing again. See 'Note about fast-forwards' section of 'git push --help' for details


Try running the following commands:

git pull origin master
git submit

This error can be avoided by not editing files on the github website directly. You should avoid doing so whenever possible.








4. When I try to run "git start" I get this message:

You have not concluded your merge (MERGE_HEAD exists).
Please, commit your changes before you can merge.

Try running:

git submit
git start
git push origin master

To avoid this error, please do NOT edit files directly on github.