Collaborative Programming
The course project involves teamwork, which is unavoidable for large-scale software development. Teamwork is difficult but it is a necessary evil to get you ready for your future workplace.
During the pandemic, it is important to maintain productive team dynamics even when the team can't be in one place. Lucky for us, today it is easier than ever to work together remotely. Consider setting up regular checks-ins with your team aligned with the course regular meeting cadence.
We will be using the course discussion board to connect with you and to keep you connected with your teammates. Each group will get a private chatroom on Campuswire. You must ensure the notifications are set correctly so you will be notified when we or other teammates reach out to you.
We will be using GitHub to host your projects and as a platform for you to collaborate on. You must understand (and use) the GitHub Flow which entails:
- Communicating in issues
- Creating branches (for adding/updating features)
- Using pull request to introduce changes
- Merging changes
TO DO
GitHub has a collection of learning resources known as Learning Lab. You must take and complete Introduction to GitHub (it is hands-on and takes about half an hour). Don't presume you already know this because you've been using GitHub. Take the introduction lab!
In what follows, I provide a summary of most essential concepts to further draw your attention to them.
Merging
When combining different versions of code, e.g. using git pull
, a merge conflict can occur if the different versions have different data in the same location. Git will try to take care of merging automatically, but if two users edit, for example, the same line, a merge conflict will have to be manually resolved.
Resolve merge conflict
To resolve a merge conflict, simply locally remove all lines and code that are not wanted and push the results.
When working in a team, it is the responsibility of the person who pushed their code last (and thus triggered the conflict) to resolve it.
Branching
Branching is a feature of Git that allows a project to move in multiple different directions simultaneously. There is one main
(or master
) branch that is always usable, but any number of new branches can be created to develop new features. Once ready, these branches can then be merged back into the main
branch.
When working in a Git repository,
HEAD
refers to the current branch being worked on. When a different branch is "checked out", theHEAD
changes to indicate the new working branch.
When merging a branch back into the main
branch, there is the possibility for merge conflicts to arise.
Useful commands:
git branch
: list all the branches currently in a repository.git branch <name>
: create a new branch calledname
.git checkout <name>
: switch current working branch toname
.git merge <name>
: merge branchname
into current working branch (normallymain
ormaster
).git merge origin/main
: mergeorigin/main
, which is the remote version of a repository normally downloaded withgit fetch
, into the local, preexistingmain
branch. (Note thatgit pull
is equivalent to runninggit fetch
and thengit merge origin/main
.)
GitHub Issues
Most software projects have a bug tracker of some kind. GitHub's tracker is called Issues, and has its own section in every repository. Although it was originally intended to track bugs, Issues are now used to keep track of enhancements, product road-map, for planning, feature requests, etc. Issues is at the heart of GitHub and acts as kind of chatroom/forum/email where all members of your team can communicate about your software project.
Pull Request
A pull request can be made to merge a branch of a repository with another branch of the same repository or even a different repository. Pull requests are a good way to get feedback on changes from collaborators on the same project.
Caution
- You must create a new branch for each iteration, and ideally, for each user story.
- The lead must create a pull request to merge the iteration branch into the
main
branch.- The lead must add all teammates as "reviewers" to get feedback and approve the pull request before merging.
- Following this process will be a factor in your grade for each iteration.