To gain experience creating and using repositories on Github.
You should have completed week eleven before attempting to complete this assignment.
In this assignment, you will be following the steps of creating a repository on Github, as discussed in week 11. Github is widely used by software developers to keep track of software projects. In your studies here you can use it for individual and group class projects, but be sure to confirm this with your instructor! You can also use it for personal projects. Some potential employers will even ask if you have a Github account to see a selection of your work.
Because it is so useful, in CS coursework and beyond, this assignment will guide you through the process of using it.
Next you will modify the README.md file. Open it up with Vim, and you should see one line which says "# assignment4" on it. Add a second line which says "This is a test project".
Then commit this change with the git commit command. For the commit message, enter "Added description". Then push the change with the git push command. If this worked well you should see a message something like the following:
ifinlay@cpsc:~/assignment4$ git push Counting objects: 3, done. Delta compression using up to 8 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 308 bytes | 308.00 KiB/s, done. Total 3 (delta 2), reused 0 (delta 0) remote: Resolving deltas: 100% (2/2), completed with 2 local objects. To github.com:IanFinlayson/assignment4.git 042879a..50f15fa master -> master
If you see a message asking to a username for https://github.com, then you need to clone the repository using SSH instead of HTTPS.
If you see a message saying "ERROR: Permission denied...Please make sure you have the correct access rights and the repository exists." then the likely issue is that you have not setup your SSH keys on Github correctly.
# just print hello world
print("Hello World!")
Add the file to the repository with git add. Then commit it with the message "Added a file", and push it the same way you did in step 4.
ifinlay@cpsc:~/assignment4$ python3 Python 3.6.6 (default, Sep 12 2018, 18:26:19) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import hello Hello World!
This will create a folder called "__pycache__" which Python uses for temporary files. If we run the "git status" command here, it will tell us that this directory is not tracked. The proper way of handling this is to add it to the .gitignore file. This is explained here. Add the __pycache__ file to .gitignore, then commit and push the change to .gitignore (using the commit message "Added .gitignore").
When you are done, git status should report "nothing to commit, working tree clean".
To submit this assignment, you will simply be turning in the URL of your repository on Github.
Open up a file called "repo.txt" and put in the URL of your repository on the first line. So for instance something like "https://github.com/GHusername/assignment4", with your actual Github username of course.
Then, turn this file in with:
submit 4 repo.txt
This will transfer your submission to the server where it will be graded. It will print your grade to the screen and record your grade. You can submit the assignment as many times as you like. Your best grade will be used.
Copyright © 2024 Ian Finlayson | Licensed under a Creative Commons BY-NC-SA 4.0 License.