Labs
All labs must be submitted using GitHub. Follow the instructions below to create a GitHub account and share it with your TA/instructor.
- Have Git installed on your computer
- Have a GitHub account (free account)
- Have a repository on GitHub where you want to commit your changes
- Keep the repository private and share with your partner and TA umail.
- GitHub free account has a limit of 3 collaborators: you, your lab partner, and primary TA umail for access.
- GitHub tutorial about repositories
- If authentication requires SSH tokens, please follow the steps in the following GitHub document to set up SSH tokens:
-
Open Terminal or Command Prompt
- On Windows, search for “cmd” in the Start menu.
- On macOS or Linux, open the Terminal application.
-
Configure Git (First-time setup)
- Use your UMASS email address:
git config --global user.name "Your Name" git config --global user.email "youremail@example.com"
- Use your UMASS email address:
-
Navigate to Your Project Directory
- Run:
cd path/to/your/project
- Run:
-
Initialize a Git Repository (If not already a Git repository)
- If your project is not yet a Git repository, initialize it by running:
git remote add origin https://github.com/yourusername/yourrepositoryname.git - Replace
https://github.com/yourusername/yourrepositoryname.gitwith the URL of your GitHub repository.
- If your project is not yet a Git repository, initialize it by running:
-
Pull Latest Changes (Optional)
- If your repository already exists and you’re collaborating, pull the latest changes from GitHub to avoid conflicts:
git pull origin main - Note: Replace
mainwith the default branch name if it’s different.
- If your repository already exists and you’re collaborating, pull the latest changes from GitHub to avoid conflicts:
-
Stage Changes for Commit
- Add the files you’ve changed or created to the staging area with:
git add . - The
.adds all changed files. If you want to add specific files, replace.with the file names.
- Add the files you’ve changed or created to the staging area with:
-
Commit Changes
- Commit your changes with a meaningful message:
git commit -m "A meaningful commit message" - Use a meaningful commit name to understand the current state of the project. For example:
- “7 segment display hex”
- “Need to debug button input”
- There is no strict rule, but the commit message should help you understand the state of the committed version.
- Commit your changes with a meaningful message:
-
Push Changes to GitHub
- Push your changes to GitHub:
git push origin main - Again, replace
mainwith your branch name if it’s different.
- Push your changes to GitHub: