- Adding your bio / Practice with git/GitHub
- Version Control
- Hands-on with GitHub
- Acknowledgement / Contact Me
In this exercise, we’ll practice working with git/GitHub to add and modify files.
In this assignment we ask you submit a recent photo and bio to share with the students in the class for which you are a ULA. The idea is to help them get to know you better.
First, a bit of background.
git and GitHub are two of the currently popular tools to keep track of the changes in text-based files.
A lot of times you’ll hear people use these terms interchangeably but that’s not entirely correct.
git runs locally on your computer and keeps track of the changes that you make to the files on your machine. You won’t be able to share these changes with your teammates using git alone, and that’s where GitHub comes in.
GitHub is a web service, a “cloud” platform that hosts your projects in repositories and allows you to share your repos with the world. There are alternative solutions to GitHub, such as GitLab and BitBucket, but they are all designed to let you
push your local changes to the cloud to enable backup, sharing, and collaboration.
Here’s a GitHub Basics Tutorial - How to Use GitHub https://youtube.com/watch?v=x0EYpi38Yp4 to get you started.
These visual guides might also be helpful in exposing what’s going on behind each
git command you run:
- A Grip On Git (A Simple, Visual Git Tutorial) https://agripongit.vincenttunru.com
- Version Control with Git https://zuckermanbrain.github.io/git-novice
- A Visual Git Reference https://marklodato.github.io/visual-git-guide/index-en.html
To really see the power of GitHub, you need to work with a team. So, let’s get started!
We will use this course’s repository in order for you to practice the open-source model of collaborating on a
PROJECT_REPO. In the open-source model, there is one or more owner and maintainer of the project repository. Typically, you as a contributor do not have a direct access to making changes to the repo – the way you contribute is by submitting your suggestions/modifications via Pull Requests.
In this example, we will be referring to this course’s website as the
PROJECT_REPO: https://github.com/ucsb-teaching-cs/s21. (You can also use the GitHub link in the upper-right corner of this page to navigate to this website’s repo.)
PROJECT_REPO using the GitHub interface. You can get the
PROJECT_REPO URL/address by clicking on the green “Code” button on the GitHub’s website (you’ll likely only need the https URL).
Note that the forked repo will produce a different URL (i.e., web address) for each person who forked this repo. We will refer to it as a
At this point, you have two alternative routes that you can take (each is described in its respective section below):
- you can continue adding the files using the GitHub web interface
- you can continue adding the files using
gitand the command line
You will need to make the changes to your fork using one of the above options. Then, when you have your picture and bio uploaded, you will need to submit a Pull Request (PR) via the GitHub web interface.
In this assignment we ask you submit a recent photo and bio to share with our students. The idea is to help them get to know you better. If you really don’t want your photo on the website, use the image that’s listed in the
In the browser, open up the
PROJECT_REPO_FORK. (Note that you need to open your fork, not the original course repo.)
- Navigate to the
assets/imagesfolder and select “Upload files” from the “Add file” dropdown.
- Use an image that shows your face and helps students recognize you.
- Use a square PNG image (300x300 px max resolution).
- Use the naming convention
XXis the course number that you are tutoring for (e.g.,
QQQis this quarter (e.g.,
- After uploading your image, remember to “Commit changes”.
- Save the filename for the image that you uploaded.
Now, navigate to the
_staffers folder in the
PROJECT_REPO_FORK GitHub repo.
- Select “Create new file” from the “Add file” dropdown.
- Name your file
NETID.mdmaking sure to substitute your
NETID(all lowercase) before the
NETIDis the part that comes before your
- Copy the following template and update the fields accordingly.
- Leave the opening and closing dashes intact.
- Update your
- Update the
pronounsto only include yours
- Leave the
Undergraduate Learning Assistant(don’t change it or add anything to it)
- Use the base filename (not the path) for the
photothat you uploaded (make sure that you added it to the correct folder)
- Add your bio - please, do not list your contact information as part of your bio.
--- name: Your Name pronouns: She/her Him/his They/their role: Undergraduate Learning Assistant ula_for: CS X photo: image.png --- Write your bio and a welcome message for the students in your course (300 to 400 words).
- Remember to “Commit changes”.
Now that you have your own fork
PROJECT_REPO_FORK (i.e., copy of the
PROJECT_REPO), which is connected to the main
PROJECT_REPO, it’s time to clone the fork to your local computer.
You can get the
PROJECT_REPO_FORK URL/address by clicking on the green “Code” button on the GitHub’s website.
To quickly check that you are cloning the correct repo (i.e., the fork, not the main project), look at the name of the repo in the top left portion of the website: it should show
YOUR_GITHUB_USERNAME / PROJECT_REPOand underneath it should say “forked from” and link to the main
PROJECT_REPO_FORK to your computer, open a Terminal window and type:
git clone PROJECT_REPO_FORK
Note: if you type
pwd (i.e., print working directory) it will produce a path to the folder on your computer which now contains a cloned version of your forked repo (
You can verify that the new repo is there by running
ls -l (Note: these are not ones (1) but “ells” (lowercase Ls)). Once you run the
ls command you should see your
PROJECT_REPO_FORK folder on the list.
Congrats! You can now switch to that folder by typing
If you run
ls you should see the README.md and other files in this repo.
Woohooo! We are done with the setup and are ready to start working with the files.
Follow the instructions and requirements above for uploading your picture and the bio.
Since you are working on the command line you’ll need to add
- your picture to the
- your bio to the
- Verify that your changes are detected by running
git status. It tells you which files you have modified.
- If the file that you created is “red” in the “Untracked files” category, make git aware that it needs to keep track of it: Add the changes by running
git add, followed by the path/name of your files.
- See the difference by running
git statusand make sure that only the files you intended to change are “green”.
- Commit your changes by running this on the command line:
git commit -m "Added a profile picture and the bio."
- Make your change show up on your fork’s github repo website by pushing this commit to the repo using
git push(note: not including
git pushdefaults to
This commit and the correspending files now live in your fork and not in the main
When you are ready for your changes/files to show up on the main website, submit a Pull Request (PR).
In order for your changes to be added to the main
PROJECT_REPO, you need to issue a Pull Request (usually abbreviated as PR).
Pull Requests (PRs) are typically issued through the GitHub web interface.
To submit a PR go to the
PROJECT_FORK_REPO page on GitHub. Click on the “Pull Requests” tab and click on the green “New Pull Request” button.
Important: make sure to select the “
compare across forks” link and then set the
head repositories and branches accordingly.
Fill out the necessary information and then to finalize your PR, click on the green “Create Pull Request”.
If you have any questions or suggestions, don’t hesitate to reach out to me via ykk@ucsb edu (remember to replace a space with a
. between the
For attribution, please keep the reference to the author:
Content developed and released under the CC BY 4.0 by Yekaterina Kharitonova.
If you would like us to add or correct anything, feel free to use the
edit this page on GitHub link below and then submit a Pull Request from your forked repo.