Do not do these steps before 2017-01-13! The repos won't be created until then.
Below are a set of steps you should follow in order to setup GitHub in your CSE Account. You should be able to work through these in order, and they should be must be connected via SSH one of the CSE linux machines such as adriatic.cse.msu.edu or arctic.cse.msu.edu.
You MAY do all development on your own machines if you choose (and can use a GitHub GUI). However, even if you do not develop on the CSE machines, these instructions will simplify testing your code there to make sure it works (as that is where all testing will be done).
This is a demo project to learn git, and as such, is not worth any points.
First, SSH to either adriatic.cse.msu.edu or arctic.cse.msu.edu using terminal (on a Mac / Unix) or Putty (on Windows). Instructions here: http://www.cse.msu.edu/Facility/Services/SSH_Docs.php
Here is a full guide to generating a key for using SSH; this key will allow you to securely use ssh and, in particular, make use of GitHub without having to repeatedly type your password: https://help.github.com/articles/generating-ssh-key
In short, you should:
Generate a key (assuming you haven't already) by typing:
ssh-keygen -t rsa -C "email@example.com"
(You should keep hitting ENTER to accept the defaults.)
cat ~/.ssh/id_rsa.pubThen copy to GitHub using the clipboard. Be sure to copy all of the contents of the file.
To test if this whole process worked, go back to the command line in your CSE account and type:
ssh -T firstname.lastname@example.org
The system will likely ask you to confirm you want to connect. When you do, it should give you a positive confirmation if all went well, saying something to the effect of:
! You've successfully authenticated, but GitHub does not provide shell access.
In setting up GitHub, you want to make sure that you can connect properly and have easy access to additional information. In your CSE account, type the following four commands. Note that in the first two you should replace "YOUR NAME" and "YOUR EMAIL ADDRESS" with the appropriate information, though make sure to leave the quotes around it. Note: the email address you input should match the one GitHub has verified to ensure notifications go to the right place.
git config --global user.name "YOUR NAME" git config --global user.email "YOUR EMAIL ADDRESS" git config --global core.editor "nano" git config --global alias.lg "log --graph --pretty=format:'%Cred%h%C(yellow)%d %Cgreen%cr %Cblue%an%Creset %s' --date=relative --all"
The first two commands let git know your name and email (which is used to mark who made each commit). The next one sets the editor to nano. Git opens an editor when you need to compose a commit message. The last command makes a new git command named "lg", it is a much improved version of "log". You invoke it with "git lg".
Also, some of you may have python3 pointing at an incorrect version of python. If you run "which python3" it should return "/usr/bin/python3". If not, run:
echo 'set path = ( /usr/bin $path )'>>~/.login-personal
This should add the correct directory to the front of your path ensuring the correct python3 executable is used. You will need to logout and re-login to have the change take effect.
One easy way to confirm that the code the instructors will grade is the code you want graded is to use continuous integration. You can configure Travis-CI to run the tests of your code every time you push commits to GitHub. It can even email you the results of the tests. Here's how to set it up:
You need to accept the invitation to join this class's GitHub organization, you can do so from the email sent by GitHub or go the organization's webpage (https://github.com/CSE480-MSU).
Then, you should clone your individual repository onto the CSE machines. Go into the Home directory and type (making sure to replace STUDENT_USERNAME with your actual MSU Net ID):
git clone email@example.com:CSE480-MSU/STUDENT_USERNAME-database.git
Once you have all of the files in place, make sure you can change the names of many of the files and commit that change (this is mostly a test to make sure that we can see the changed files).
You should also add remote "instructor" for future projects scaffold and solutions.
git remote add instructor firstname.lastname@example.org:CSE480-MSU/instructor-database.git
Edit README.txt to have your name. Next commit your change with:
git add README.txt git commit -m "My first commit"
You can see the change in the log with:
You should push your commits to GitHub now:
git push -u origin master
In the future, you only need to run
git push to push.
Finished solving Project0 (edit/create README.txt and project.py). You can run the tests with:
Be sure to commit and push early and often.
Hence forth, you should also fetch and merge from the instructor remotes to get changes made to that repository (new projects, solutions, and bugfixes). I've pushed the first project Project1 to the instructor repo. Follow these commands to incorporate that code with your own.
git fetch instructor git lg git merge instructor/master -m "Merging with instructor"
You should now have a Project1 folder in your repository.
In the sidebar, there is Helpful Links page that recommends resources on learning git. If this is your first time with the software, you must work though one of the tutorials before asking for help.