-
Notifications
You must be signed in to change notification settings - Fork 0
Git and GitHub During the Assignment
Module Two uses Git and GitHub to help you manage and back up your assignment work.
You completed the initial GitHub and course IDE setup in Module One. During Module Two, you begin using those tools as part of a programming workflow.
Use the top-level assignment README for the exact commands. This page explains what the commands and systems are doing.
Assignment README:
https://github.com/GC-STEM/it140-m2-assignment
Git is the version-control system installed in your course IDE.
Git records changes to project files in a local repository.
GitHub is the web service that stores a remote copy of a Git repository and provides repository tools such as Issues and Discussions.
During this assignment:
- You edit files on your CVD or local computer.
- Git can record versions of those files.
- GitHub can store the commits you push.
- D2L Brightspace remains the assignment submission and grading system.
For the course-wide introduction to Git and GitHub, see:
https://github.com/GC-STEM/it140-m1-setup-tasks/wiki/GitHub-in-IT-140
The public course repository is:
GC-STEM/it140-m2-assignment
It is a template repository containing the starting assignment files.
The assignment README guides you through creating your own personal private repository from that template.
That gives you:
- The original course template on GitHub
- Your personal assignment repository on GitHub
- A local clone of your personal repository on the CVD or your supported computer
You normally do your work in the local clone of your personal repository.
Do not edit the public course template.
These actions are related, but they are not the same.
Saving writes your current edits to the file on the computer where you are working.
For example:
- You change
name_age.py. - You save the file in VS Code.
- The local file now contains your new code.
A saved file is not automatically backed up to GitHub.
A commit records selected changes in the local Git repository.
A commit creates a point in the project's version history.
The assignment README provides commands that stage only the student working and deliverable files and then create a commit.
A push sends local commits to the GitHub repository connected to your clone.
After a successful push, GitHub contains those committed changes.
A useful model is:
Edit → Save → Commit → Push
Pushing work to GitHub gives you an online copy of your repository history.
It does not submit the assignment for grading.
The assignment workflow is:
Develop in your repository → back up with GitHub → submit required deliverables in D2L Brightspace
Always use the current Module Two Assignment Guidelines and Rubric in D2L to determine:
- Which files to submit
- Required file formats
- Submission location
- Grading criteria
- Due dates
The assignment uses:
git status
This command reports the state of files in the local Git repository.
It can help you see whether files are:
- Modified
- Staged for a commit
- Untracked
- Already committed
Reading git status before and after a commit is a useful way to understand what Git is about to record.
The assignment README uses git add with specific assignment file paths.
This stages the named changes for the next commit.
Staging lets you choose what will be included in a commit.
For Module Two, use the exact command in the current README instead of running broader commands that may stage course-managed files you did not intend to change.
A commit records the staged changes in local version history.
The commit message briefly describes the purpose of that saved point.
The assignment README supplies an appropriate example commit command.
If Git reports that there is nothing to commit, that usually means Git does not see new local changes that need a new commit.
A push sends commits from your local repository to your personal GitHub repository.
After pushing, you can open your personal repository on GitHub and confirm that the latest committed work appears there.
This gives you another copy of your work if the local environment later has a problem.
You do not need a new commit after every line of code.
Useful checkpoints include moments when:
- You completed an SDLC phase
- The program runs after a meaningful change
- You completed the Part A program
- You completed the Part B reflection
- You are stopping work for the day
Periodic commits create useful recovery points without interrupting every small edit.
You create your personal assignment repository once.
When you return on the same environment, open the existing local repository and continue working.
Do not create another repository from the course template every time you work.
If you move to another computer that does not have your personal repository, the assignment README provides the command for cloning your existing personal repository.
Use the current README rather than creating a second personal assignment repository with the same purpose.
The assignment README contains recovery procedures.
One option preserves the current local folder and clones a fresh copy of the personal repository you previously pushed to GitHub.
This is useful when:
- The GitHub copy is good.
- The local copy has become damaged or confusing.
Because recovery changes folders and repositories, follow the exact current procedure rather than improvising commands.
Recovery instructions:
https://github.com/GC-STEM/it140-m2-assignment#reset-your-assignment-repository
The README also provides a procedure for starting over from the original course template.
That process is different from simply restoring a good copy from your personal GitHub repository.
Use it only when the README's description matches what you intend to do.
Starting over from the template does not automatically move work that exists only in the previous repository into the new one.
If you are trying to recover work, avoid deleting your local folder or GitHub repository before you know which copy contains the work you need.
The provided recovery process preserves the old copy with a backup name.
Keeping the old copy first gives you a chance to recover files later if needed.
The Module Two repository provides two different communication tools.
Use GitHub Issues to report a technical problem with:
- Provided repository files
- Broken links
- Starter files
- Test files
- Course tooling used by the repository
Do not post a complete graded solution.
Use GitHub Discussions for repository-related questions and discussions when appropriate.
Questions about grading, due dates, accommodations, or instructor feedback belong with your instructor through D2L Brightspace.
Before posting terminal output, screenshots, or error messages, check them for private information.
Do not post:
- Passwords
- Authentication codes
- Recovery codes
- Personal access tokens
- Private contact information
- Student identification numbers
- Other credentials or secrets
- Complete solutions to graded assignments
If you are unsure whether something is safe to post, contact your instructor before sharing it publicly.
- Exact Module Two Git commands: https://github.com/GC-STEM/it140-m2-assignment
- General Git/GitHub background: https://github.com/GC-STEM/it140-m1-setup-tasks/wiki/GitHub-in-IT-140
- Repository problems: Assignment Problems and Support
- Testing help: Testing and Debugging