0% found this document useful (0 votes)
42 views

Tutorial-4 Git Teamwork

The document provides instructions for software engineering students to collaborate on an Android app project using GitHub. It explains how the technical coordinator will create a new project in Android Studio, push it to GitHub, and invite teammates to collaborate. It then describes how teammates can clone the project, make changes by adding new activities to their local copies, commit changes to branches, and create pull requests to merge their work. Finally, it shows how teammates can always get the latest project code from GitHub to stay in sync with each other.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

Tutorial-4 Git Teamwork

The document provides instructions for software engineering students to collaborate on an Android app project using GitHub. It explains how the technical coordinator will create a new project in Android Studio, push it to GitHub, and invite teammates to collaborate. It then describes how teammates can clone the project, make changes by adding new activities to their local copies, commit changes to branches, and create pull requests to merge their work. Finally, it shows how teammates can always get the latest project code from GitHub to stay in sync with each other.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

SWEN-101:

Software Engineering Freshman Seminar Tutorial 4: Android Studio – GitHub Teamwork



Android Studio – GitHub Teamwork
Objectives: Learn project integration using github. By the end of this tutorial you will be:
• Familiar with the features of version control e.g. push, pull, etc.
• Able to develop a project as a team.
Now that you know your team members, let us have a look at how you will develop the project
for this course together, as a team, with the help of GitHub.
Part 1: Technical coordinator creates new Hello World project
Firstly, each team pick a technical coordinator who will start the creation of a new project on
Android Studio with the knowledge gained during the previous weeks of classes. To help you
recollect, following are few of the screenshots on creation of a project in Android Studio.

1

SWEN-101: Software Engineering Freshman Seminar Tutorial 4: Android Studio – GitHub Teamwork

#end_of_part_1

2

SWEN-101: Software Engineering Freshman Seminar Tutorial 4: Android Studio – GitHub Teamwork

Part 2: Technical coordinator pushes the project to Github
The technical coordinator after creating the new project, will push it to Github.
1. Click on the “VCS” option from the menu at the top of the Android Studio Window and then
select the option of “Import into Version Control” à “Share Project on GitHub”.

2. Then, you’ll see a window which will ask you for your GitHub login details. You need to
give your credentials and then click on “login”.

3. Now, you’ll see a new window pops up asking you to give a repo name. Just enter the name
of your project and click on “Share”

3

SWEN-101: Software Engineering Freshman Seminar Tutorial 4: Android Studio – GitHub Teamwork

4. Then you’ll see a new window which asks you about what files you want to be added to the
repo, just select all the files and click on “ok”

5. You’ll see a message that says that the push was successful.

#end_of_part_2

4

SWEN-101: Software Engineering Freshman Seminar Tutorial 4: Android Studio – GitHub Teamwork

Part 3: Technical coordinator invites team members to join & members clone the project
Now that the technical coordinator has created a new project and pushed it to GitHub, s/he will
add collaborators to the project. Adding collaborators to the project repo helps the team members
to contribute to the project.
1. The technical coordinator will login to his/her GitHub account and will choose the repo
that he/she has created in the previous step. Once you are in the repo page click on
“settings” displayed at top right corner.

2. You’ll see a page that has a display of options to the left. Click on “Collaborators”.

3. Once you click on “Collaborators” you will see an option of adding collaborator.

5

SWEN-101: Software Engineering Freshman Seminar Tutorial 4: Android Studio – GitHub Teamwork

4. You need to enter the person’s email address or their Git username. Click on “Add
Collaborator”.

5. After adding a collaborator for the project, an invitation to collaborate will be sent to the
person. Once the person accepts the invitation he/she can contribute to the project.
Similarly you can invite all your team members.

Here is a screenshot of the invitation the collaborator will receive in the email.

6

SWEN-101: Software Engineering Freshman Seminar Tutorial 4: Android Studio – GitHub Teamwork

6. The team member clicks on the “View Invitation” button and he/she will be directed to
their github page. Click on “Accept Invitation” button.

7. You will see that you have been added as a contributor to the project and a message “you
have push access” will be displayed.

8. When all team members accept their invitations, the contributors to the project will be
added and the technical coordinator will be termed as the “owner” of the project.
9. Each team member (other than the technical coordinator) must download the project
from GitHub. To do so, click on the “Check out project from Version Control” option
and then “GitHub” in Android Studio.

7

SWEN-101: Software Engineering Freshman Seminar Tutorial 4: Android Studio – GitHub Teamwork

10. Enter your Login credentials, and click Login.

11. Click on “Clone”.

12. Click on “Yes” and you’ll see that the project has cloned.

#end_of_part_3

8

SWEN-101: Software Engineering Freshman Seminar Tutorial 4: Android Studio – GitHub Teamwork

Part 4: Update the shared project on your local machine and upload the changes to Github
Now that the team members have the project on their local systems, they will each create an
activity and when the team member is sure of the changes s/he made, the member can integrate
the changes made on the local machine (i.e. merge into a branch) to the shared project on Github
that was created by the technical coordinator (i.e. master branch).
1. Each team member (including the technical coordinator) creates a new activity (in the
shared project). Click on “file” à “New” à “Activity” à Empty activity (each team
member names the activity with their own name e.g. activity_userid).

2. You will see a window which displays all the files that will be created additionally, and
Android Studio will ask you if you like to add these files to Git. Click “OK”.
Note: Clicking on “OK” will not add these files to the remote system (github.com).
Instead they are added to your local system.

3. Create a new branch other than the master, to facilitate code integration. Click on “VCS”
à “Git” à “Branches”.

9

SWEN-101: Software Engineering Freshman Seminar Tutorial 4: Android Studio – GitHub Teamwork

4. Click on “New Branch”. Label the branch as per choice and click “OK”.

5. Then you need to “commit” (add these changes made in local system to the remote
system). Go to “VCS” à click on “Commit”.

10

SWEN-101: Software Engineering Freshman Seminar Tutorial 4: Android Studio – GitHub Teamwork

6. Now that you have committed the changes, you will “push” these changes to the remote
system (github.com). Click on “VCS” à “Git” à “Push”. Enter your login details and
click on “Push”.

7. To inform your team of the changes you made and would like to integrate to the shared
project on github, create a pull request. Go to “VCS” à click on “Git” à “Create Pull
Request”. Give your Login Credentials.

11

SWEN-101: Software Engineering Freshman Seminar Tutorial 4: Android Studio – GitHub Teamwork

8. Give a brief description as to what changes you are making to the project (e.g. create a
new screen with my name displayed in it) and then click on “OK”. If you click on “Show
Diffs” you will see the changes of the file before and after.

9. Once that is done you will see a status message.

10. This is how your GitHub page will look like after the pull request is made. Once
everyone reviewed the changes and all the team members are satisfied with the changes,
click on the “Merge Pull Request” and the branches will combine. Now your master
branch is up-to-date.

#end_of_part_4

12

SWEN-101: Software Engineering Freshman Seminar Tutorial 4: Android Studio – GitHub Teamwork

Part 5: Download the latest version of the shared project on Github
Now that we have seen how a technical coordinator can create a new project and add
collaborators to it on GitHub, and how team members can contribute to the project. We will
download the updated project from github and run it.
1. Click on “VCS” à “Update Project”. You will see a message at right bottom corner that
says, “All files are up-to-date”. So, now you have the same project that is there on
GitHub. Now click on “run”.

2. You will see a build successful message and the emulator will look as shown below.

#end_of_part_5
#end_of_tutorial_4

13

You might also like