Overview of Software Engineering (COMSM0110) Introduction to Git & GitHub.
By the end of this session you should have:
- Created a GitHub account
- One team member should have created a repository.
- All group members should be added to the repository.
- Names, GitHub Usernames Should be added to the README.
- You should have had the chance to play around with features of GitHub and interacted with the repository using git.
We recommend using a lab machine for this task as it already has Git and VSCode installed. You can of course use an IDE other than VSCode but these instructions use VSCode as an example, other IDEs should provide similar tools for interacting with Git. If you are using your own machine then you will need to install git.
This will not be the same repository as the one you will use for your coursework. After this lab we will setup a repository for you using your the GitHub name that you provide us.
- Go to GitHub.
- Click 'Sign Up' in the top right corner.
- Follow the instructions on the page.
We recommend creating a GitHub account using a personal email address. This will allow you to use the account after leaving the university.
Only one member of your team needs to complete this section but everyone should follow along with what they are doing.
- In the upper-right corner of any page, select plus, then click New repository.
-
Use the 'Owner' dropdown menu to select your GitHub account as the owner of the repository.
-
Choose a repository name (no need to put too much thought into this, this is just a test repository which you can delete later).
-
Ensure that the repository is set as
Public
-
Select
Add a README file
. -
Click
Create Repository
.
Only one member of your team needs to complete this section but everyone should follow along with what they are doing.
- Navigate to the settings tab of the repository.
-
In the "Access" section of the sidebar, click
Collaborators & teams
. -
Select
Add people
and add team members by searching for their username.
All team members should now have permission to clone the repository and push new or edited code.
All team members should complete this section.
- On your repository on GitHub click the
code dropdown
- Copy the HTTPS address provided
-
Open VSCode
-
Navigate to the Source Control tab on the left sidebar
-
Select
Clone Repository
-
Paste your HTTPS address into the search bar and select the repository.
-
Follow any instructions given by VSCode on cloning the repository (It may ask you to login to GitHub).
VSCode should automatically open the local repository in the current browser.
Each team member should try out pushing code by editing the README.md file to include their name, university email address and GitHub username. It is essential that you complete this section as this information will allow us to setup your coursework repository.
Since we haven't got on to how to use branches yet, only one team member should do this section at once.
-
Use VSCode to add your name, university email address and GitHub username in the format
<name>, <email>, <github-username>
. e.g.Alex Elwood, wh20899@bristol.ac.uk, alexelwood14
-
Use the source control tab in the left sidebar to commit changes to the readme (see additional docs if you are stuck).
-
Click the Synchronize Changes button on the bottom left of the window. Once this is complete the change should be visible on GitHub
-
All team members can now Synchronize Changes, and should be able to see the updated README locally.
Once each team member has their name, university email address and GitHub username in the README.md, send a link to your repository to Alex Elwood on Teams. In the next few days we will be setting up your coursework repositories and sending out joining invites.
The next essential feature of Git is branches. Take a look at the GitHub documentation on branches and have a go using branches interacting with branches in your test repository. Note: this task has a lot of overlap with Overview of Software Tools.