Git and GitHub are tools that enable efficient collaborative software development. In this tutorial, we will cover a few fundamental tools, namely:
- Issues
- Commits
- Forking
- Pull Requests
The focus of this tutorial will be farmiliarizing yourself with git, not writing code. To do this I have written a very simple python3 script, main.py
. In order to run main.py
from the command line, simply execute the following:
python3 main.py
Please make sure you
- Install git on your computer
- Create a GiHub account
- Install python3 on your computer (not strickly necessary, but very illustrative).
You can read the issue here. At the begining of the tutorial I will assign you are group number which will indicate exactly what change you should make.
- Log into GitHub
- Create a fork of this repository into your own GitHub account
- Navigate to your fork and clone to your local machine via a terminal window, e.g.
git clone https://github.com/eric-fork/git_tutorial.git
git remote add git_tutorial https://github.com/eric-fork/git_tutorial
But make sure to update the URL above to your own fork!
Make your assigned change to main.py
as indicated in the issue. Save main.py
and then commit and push to GitHub. Make sure to provide a descriptive commit message, e.g.
git add main.py
git commit -m "Uncommenting group 1 print statement"
git push origin master
Create a new pull request in the orignal GitHub repository here. Click the green "New Pull Request" button and then the "compare accross forks" link. Define the base (where you want to send your changes) and head (where your changes are coming from) repositories. Then click the green "Create pull request button" and provide a description of your changes, example here.