2
CS61B, Spring 2025 @ UC Berkeley
Industry Practices for Collaboration
Software Engineering II
Lecture 31
Stella Kaval (she/her)
Kanav Mittal (he/him)
Introduction
Lecture 31, CS61B Spring 2025
Introduction
Agile Development
Review: Git Commands
Git Branching and Merging
Pull Requests
Summary
What comes to mind when you think about a software engineer’s day to day work?
Myth: Software engineering is mostly coding by yourself
Collaboration
Customers
Engineers
Past and future employees
Product managers, designers
You
Introduction to collaboration in software engineering: open office
Introduction to collaboration in software engineering: open office
Advantages
Disadvantages
Today’s topics
Agile Development
Lecture 31, CS61B Spring 2025
Introduction
Agile Development
Review: Git Commands
Git Branching and Merging
Pull Requests
Summary
Collaborative Project
Name
Purpose
Key Features
Talking to Customers
Why Customer Input Matters
Questions
Findings
Top user suggestions
Any class suggestions?
Next Steps
Given our findings, now what?
Agile Software Development Review
“Iterative approach to delivering a project, which focuses on continuous releases that incorporate customer feedback” (Atlassian)
Set of values that guide software development processes through 4 principles:
Agile Software Development Review
“Iterative approach to delivering a project, which focuses on continuous releases that incorporate customer feedback” (Atlassian)
Set of values that guide software development processes through 4 principles:
Individuals and interactions
Working software
Customer collaboration
Responding to change
Agile Development
Scrum is an Agile framework for managing work
Product Backlog List of tasks from the product roadmap, written as user stories
Sprint Backlog Project broken into pieces called “sprints”
Sprint
1-4 weeks to complete an iteration, with a daily stand-up
Working increment of the product
Applying Agile to 61Belly
Product Backlog
Sprint 1: 4/11 → 4/25
Sprint 2: 4/25 → 5/1
Sprint 3: 5/1 → 5/15
Applying Agile to 61Belly
Product Backlog
Sprint 1: 4/11 → 4/25
Sprint 2: 4/25 → 5/1
Sprint 3: 5/1 → 5/15
Applying Agile to 61Belly
Product Backlog
Sprint 1: 4/11 → 4/25
Sprint 2: 4/25 → 5/1
Sprint 3: 5/1 → 5/15
Applying Agile to 61Belly
Product Backlog
Sprint 1: 4/11 → 4/25
Sprint 2: 4/25 → 5/1
Sprint 3: 5/1 → 5/15
Agile Development Tools
What tools do software engineers use to track and put these plans into action?
Jira is a software application developed by Atlassian for issue tracking and project management
Let’s create a Jira project for 61Belly!
Jira Demo
Jira Demo
A Jira ticket is a task, bug, or request within a project
Jira Demo
Jira Demo
Jira Demo
Jira Demo
Jira Demo
Jira Demo
Developing features and collaboration
Why do we use Jira? It helps communicate:
Developing features and collaboration
Why do we use Jira? It helps communicate:
We talked about completing these tickets in the backlog on a high level, but how do we actually code them?
Solution 1: Google Docs
Google Docs is great at working together on documents
Git is more powerful!
Advantages
Disadvantages
Review: Git Commands
Lecture 31, CS61B Spring 2025
Introduction
Agile Development
Review: Git Commands
Git Branching and Merging
Pull Requests
Summary
Git as a version control system
Git as a version control system
working directory
Git as a version control system
working directory
staging area
add
Git as a version control system
working directory
staging area
local repo (.git folder)
add
commit
Git as a version control system
working directory
staging area
local repo (.git folder)
remote repo
add
commit
push
Commit History
58bc8a
Create Restaurant class
6af3e2
Initial commit
Commit History
58bc8a
Create Restaurant class
6af3e2
Initial commit
Commit ID
Commit message
Commit History
58bc8a
Create Restaurant class
6af3e2
Initial commit
Commit History
58bc8a
Create Restaurant class
7126fd
Added getRating method to Restaurant
6af3e2
Initial commit
Commit History
58bc8a
Create Restaurant class
7126fd
Added getRating method to Restaurant
6af3e2
Initial commit
Commit History
58bc8a
Create Restaurant class
7126fd
Added getRating method to Restaurant
6af3e2
Initial commit
Commit History
58bc8a
Create Restaurant class
7126fd
Added getRating method to Restaurant
6af3e2
Initial commit
Going back to a previous version of your code
Going back to a previous version of your code
Going back to a previous version of your code
6af3e2
58bc8a
7126fd
ffc831
7500af
b7f4e1
1072f1
Going back to a previous version of your code
Git as a tool for collaboration
Stella’s local repository
Kanav’s local repository
Git as a tool for collaboration
Stella’s local repository
Kanav’s local repository
git push
git push
Git as a tool for collaboration
Stella’s local repository
Kanav’s local repository
git pull
git pull
git push
git push
Git as a tool for collaboration
Stella’s local repository
Kanav’s local repository
git pull
git pull
git push
git push
Git as a tool for collaboration
Stella’s local repository
Kanav’s local repository
git pull
git pull
git push
git push
Collaborating on the same commit history
Collaborating on the same commit history
Collaborating on the same commit history
Stella
Kanav
Collaborating on the same commit history
Stella creates a Restaurant class and commits it
58bc8a
Stella: Create Restaurant class
Stella
Kanav
Collaborating on the same commit history
Stella pushes her changes to GitHub so others can access them
58bc8a
Stella: Create Restaurant class
Stella
58bc8a
Stella: Create Restaurant class
Kanav
Collaborating on the same commit history
Kanav pulls Stella’s changes from GitHub
58bc8a
Stella: Create Restaurant class
Stella
58bc8a
Stella: Create Restaurant class
Kanav
58bc8a
Stella: Create Restaurant class
Collaborating on the same commit history
Kanav works on creating a Cafe subclass and commits it
58bc8a
Stella: Create Restaurant class
Stella
58bc8a
Stella: Create Restaurant class
Kanav
58bc8a
Stella: Create Restaurant class
8a6de7
Kanav: Created Cafe subclass
Collaborating on the same commit history
Kanav pushes his commit history to GitHub
58bc8a
Stella: Create Restaurant class
Stella
58bc8a
Stella: Create Restaurant class
Kanav
58bc8a
Stella: Create Restaurant class
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
Collaborating on the same commit history
Stella pulls the commit history from GitHub. Her commit history is fast-forwarded to match the remote’s.
58bc8a
Stella: Create Restaurant class
Stella
58bc8a
Stella: Create Restaurant class
Kanav
58bc8a
Stella: Create Restaurant class
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
Collaborating on the same commit history
Stella works on adding text reviews to Restaurant.java
58bc8a
Stella: Create Restaurant class
Stella
58bc8a
Stella: Create Restaurant class
Kanav
58bc8a
Stella: Create Restaurant class
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
4f8e44
Stella: Added text reviews to Restaurant
Collaborating on the same commit history
Kanav works on adding a coffee ranking feature to Cafe.java
58bc8a
Stella: Create Restaurant class
Stella
58bc8a
Stella: Create Restaurant class
Kanav
58bc8a
Stella: Create Restaurant class
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
cf3780
Kanav: Added coffee ranking to Cafe.java
4f8e44
Stella: Added text reviews to Restaurant
Collaborating on the same commit history
Stella pushes her work to GitHub
58bc8a
Stella: Create Restaurant class
Stella
58bc8a
Stella: Create Restaurant class
Kanav
58bc8a
Stella: Create Restaurant class
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
4f8e44
Stella: Added text reviews to Restaurant
Collaborating on the same commit history
Kanav wants to push to GitHub, but first he tries to pull from GitHub…
58bc8a
Stella: Create Restaurant class
Stella
58bc8a
Stella: Create Restaurant class
Kanav
58bc8a
Stella: Create Restaurant class
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
4f8e44
Stella: Added text reviews to Restaurant
Collaborating on the same commit history
Kanav tries to pull from GitHub, but he now finds that the remote’s history diverges from his
58bc8a
Stella: Create Restaurant class
Stella
58bc8a
Stella: Create Restaurant class
Kanav
58bc8a
Stella: Create Restaurant class
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
4f8e44
Stella: Added text reviews to Restaurant
Merging
Merging
Merging
Merging
If you’ve seen a message like this, this is executing a merge
Collaborating on the same commit history
Kanav tries to pull from GitHub, but he now finds that the remote’s history diverges from his
58bc8a
Stella: Create Restaurant class
Stella
58bc8a
Stella: Create Restaurant class
Kanav
58bc8a
Stella: Create Restaurant class
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
4f8e44
Stella: Added text reviews to Restaurant
Collaborating on the same commit history
First step of the merge: identify the closest common ancestor
58bc8a
Stella: Create Restaurant class
Kanav
58bc8a
Stella: Create Restaurant class
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
cf3780
Kanav: Added coffee ranking to Cafe.java
4f8e44
Stella: Added text reviews to Restaurant
closest common ancestor
Collaborating on the same commit history
Second step of the merge: combine changes and add a merge commit
58bc8a
Stella: Create Restaurant class
Kanav
58bc8a
Stella: Create Restaurant class
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
cf3780
Kanav: Added coffee ranking to Cafe.java
4f8e44
Stella: Added text reviews to Restaurant
closest common ancestor
Edited Restaurant.java
Edited
Cafe.java
Collaborating on the same commit history
Second step of the merge: combine changes and add a merge commit
58bc8a
Stella: Create Restaurant class
Stella
58bc8a
Stella: Create Restaurant class
Kanav
58bc8a
Stella: Create Restaurant class
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
4f8e44
Stella: Added text reviews to Restaurant
4f8e44
Stella: Added text reviews to Restaurant
d90e17
Kanav: merge commit
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
Collaborating on the same commit history
Kanav pushes his commit history
58bc8a
Stella: Create Restaurant class
Stella
58bc8a
Stella: Create Restaurant class
Kanav
58bc8a
Stella: Create Restaurant class
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
8a6de7
Kanav: Created Cafe subclass
4f8e44
Stella: Added text reviews to Restaurant
4f8e44
Stella: Added text reviews to Restaurant
d90e17
Kanav: merge commit
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
d90e17
Kanav: merge commit
cf3780
Kanav: Added coffee ranking to Cafe.java
Collaborating on the same commit history
Kanav edits Restaurant.java to add photos to reviews and makes a commit
Stella
Kanav
4f8e44
Stella: Added text reviews to Restaurant
4f8e44
Stella: Added text reviews to Restaurant
d90e17
Kanav: merge commit
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
d90e17
Kanav: merge commit
cf3780
Kanav: Added coffee ranking to Cafe.java
Collaborating on the same commit history
Kanav pushes his changes to GitHub
Stella
Kanav
4f8e44
Stella: Added text reviews to Restaurant
4f8e44
Stella: Added text reviews to Restaurant
d90e17
Kanav: merge commit
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
d90e17
Kanav: merge commit
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
Collaborating on the same commit history
Stella edits Restaurant.java to add star ratings to reviews and makes a commit
Stella
Kanav
4f8e44
Stella: Added text reviews to Restaurant
4f8e44
Stella: Added text reviews to Restaurant
d90e17
Kanav: merge commit
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
d90e17
Kanav: merge commit
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
be478a
Stella: Added ratings to Restaurant
Collaborating on the same commit history
Stella wants to push her changes to GitHub, but…
Stella
Kanav
4f8e44
Stella: Added text reviews to Restaurant
4f8e44
Stella: Added text reviews to Restaurant
d90e17
Kanav: merge commit
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
d90e17
Kanav: merge commit
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
be478a
Stella: Added ratings to Restaurant
Collaborating on the same commit history
Stella wants to push her changes to GitHub, but she first pulls (pull before push!)
Stella
Kanav
4f8e44
Stella: Added text reviews to Restaurant
4f8e44
Stella: Added text reviews to Restaurant
d90e17
Kanav: merge commit
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
d90e17
Kanav: merge commit
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
be478a
Stella: Added ratings to Restaurant
Collaborating on the same commit history
Stella pulls from GitHub, but local and remote histories diverge.
Stella
Kanav
4f8e44
Stella: Added text reviews to Restaurant
4f8e44
Stella: Added text reviews to Restaurant
d90e17
Kanav: merge commit
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
d90e17
Kanav: merge commit
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
be478a
Stella: Added ratings to Restaurant
Collaborating on the same commit history
Step 1: Git identifies Closest Common Ancestor
Stella
Kanav
4f8e44
Stella: Added text reviews to Restaurant
4f8e44
Stella: Added text reviews to Restaurant
d90e17
Kanav: merge commit
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
d90e17
Kanav: merge commit
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
be478a
Stella: Added ratings to Restaurant
Collaborating on the same commit history
Step 2: Combine changes from the Closest Common Ancestor to the latest commits of the histories
Stella
Kanav
4f8e44
Stella: Added text reviews to Restaurant
4f8e44
Stella: Added text reviews to Restaurant
d90e17
Kanav: merge commit
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
d90e17
Kanav: merge commit
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
be478a
Stella: Added ratings to Restaurant
Collaborating on the same commit history
Step 2: Combine changes made from Closest Common Ancestor to latest commits of the histories
Stella
Kanav
4f8e44
Stella: Added text reviews to Restaurant
4f8e44
Stella: Added text reviews to Restaurant
d90e17
Kanav: merge commit
4f8e44
Stella: Added text reviews to Restaurant
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
d90e17
Kanav: merge commit
cf3780
Kanav: Added coffee ranking to Cafe.java
e3abc2
Kanav: Added photos to reviews in Restaurant
be478a
Stella: Added ratings to Restaurant
Restaurant.java edited
Restaurant.java edited
Merge conflicts
Merge conflicts
public class Restaurant {
<<<<<<< HEAD
private int[] ratings;
public Restaurant (int[] ratings) {
this.ratings = ratings;
=======
private Photo[] photos;
public Restaurant (Photo[] photos) {
this.photos = photos
>>>>>>> e3abc2
}
}
Merge conflicts
public class Restaurant {
<<<<<<< HEAD
private int[] ratings;
public Restaurant (int[] ratings) {
this.ratings = ratings;
=======
private Photo[] photos;
public Restaurant (Photo[] photos) {
this.photos = photos
>>>>>>> e3abc2
}
}
Local version
Merge conflicts
public class Restaurant {
<<<<<<< HEAD
private int[] ratings;
public Restaurant (int[] ratings) {
this.ratings = ratings;
=======
private Photo[] photos;
public Restaurant (Photo[] photos) {
this.photos = photos
>>>>>>> e3abc2
}
}
Local version
Remote version
Merge conflicts
public class Restaurant {
<<<<<<< HEAD
private int[] ratings;
public Restaurant (int[] ratings) {
this.ratings = ratings;
=======
private Photo[] photos;
public Restaurant (Photo[] photos) {
this.photos = photos
>>>>>>> e3abc2
}
}
Local version
Remote version
Merge conflicts are messy!
Merge conflicts are messy!
Merge conflicts are messy!
Solution 1: Just push and pull less
Solution 1: Just push and pull less
From linear to branches
From linear to branches
Git Branching and Merging
Lecture 31, CS61B Spring 2025
Introduction
Agile Development
Review: Git Commands
Git Branching and Merging
Pull Requests
Summary
Branches
Branches
Branches
Branches
Branches
Branches
Branching allows you to have other lines of development
6af3e2
Initial commit
8954de
Created Cafe subclass
cafe
stars
7df53a
Added star ratings
cf3780
Created Cafe subclass
main
HEAD
Merging
Merging
Merging
Merging joins together two lines of development
6af3e2
Initial commit
8954de
Created Cafe subclass
cafe
main
stars
7df53a
Added star ratings
cf3780
Created Cafe subclass
9478fc
Merge branch cafe
HEAD
Merging joins together two lines of development
6af3e2
Initial commit
8954de
Created Cafe subclass
cafe
main
stars
7df53a
Added star ratings
cf3780
Created Cafe subclass
9478fc
Merge branch cafe
HEAD
Merging joins together two lines of development
6af3e2
Initial commit
8954de
Created Cafe subclass
cafe
main
stars
7df53a
Added star ratings
cf3780
Created Cafe subclass
9478fc
Merge branch cafe
HEAD
Branching demo
Initially, our main branch starts off by pointing to our initial commit.
6af3e2
Initial commit
main
Branching demo
git branch cafe
6af3e2
Initial commit
main
cafe
Branching demo
git switch cafe
6af3e2
Initial commit
main
cafe
Branching demo
git commit -m “Created Cafe subclass”
6af3e2
Initial commit
8a6de7
Created Cafe subclass
cafe
main
Branching demo
git commit -m “Created Cafe subclass”
6af3e2
Initial commit
8a6de7
Created Cafe subclass
cafe
main
Branching demo
git switch main
6af3e2
Initial commit
8a6de7
Created Cafe subclass
cafe
main
Branching demo
git branch stars
6af3e2
Initial commit
8a6de7
Created Cafe subclass
cafe
main
stars
Branching demo
git switch stars
6af3e2
Initial commit
8a6de7
Created Cafe subclass
cafe
main
stars
Branching demo
git commit -m “Added star ratings”
6af3e2
Initial commit
8a6de7
Created Cafe subclass
cafe
main
stars
7df53a
Added star ratings
Branching demo
git switch cafe
6af3e2
Initial commit
8a6de7
Created Cafe subclass
cafe
main
stars
7df53a
Added star ratings
Branching demo
git commit -m “Added coffee ranking to Cafe.java”
6af3e2
Initial commit
8a6de7
Created Cafe subclass
cafe
main
stars
7df53a
Added star ratings
cf3780
Added coffee ranking to Cafe.java
Branching demo
git switch main
6af3e2
Initial commit
8a6de7
Created Cafe subclass
cafe
main
stars
7df53a
Added star ratings
cf3780
Added coffee ranking to Cafe.java
From linked list to trees
6af3e2
Initial commit
8a6de7
Created Cafe subclass
7df53a
Added star ratings
cf3780
Added coffee ranking to Cafe.java
Branching demo
git merge main
6af3e2
Initial commit
8954de
Created Cafe subclass
cafe
main
stars
7df53a
Added star ratings
cf3780
Created Cafe subclass
9478fc
Merge branch cafe
Feature branches
Feature branches
Feature branches
Feature branches
Feature branch demo with multiple developers
Branch: main
Commit: Release v1.1
stella
kanav
Feature branch demo with multiple developers
Kanav: creates find-friends branch
Branch: main
Commit: Release v1.1
Branch: find-friends Commit: Added functionality
stella
kanav
Feature branch demo with multiple developers
Stella: creates add-friends branch and works on it
Branch: main
Commit: Release v1.1
Branch: find-friends Commit: Added functionality
Branch: add-friends Commit: Added invite friend
Branch: add-friends Commit: Fixed add friend bug
stella
kanav
Feature branch demo with multiple developers
Kanav: works some more on find-friends branch
Branch: main
Commit: Release v1.1
Branch: find-friends Commit: Added functionality
Branch: find-friends Commit: Improved UI
Branch: add-friends Commit: Added invite friend
Branch: add-friends Commit: Fixed add friend bug
stella
kanav
Feature branch demo with multiple developers
Kanav: merges find-friends branch into main
Branch: main
Commit: Release v1.1
Branch: find-friends Commit: Added functionality
Branch: find-friends Commit: Improved UI
Branch: add-friends Commit: Added invite friend
Branch: add-friends Commit: Fixed add friend bug
stella
kanav
Feature branch demo with multiple developers
Step 1: Git identifies Closest Common Ancestor of find-friends and main
Branch: main
Commit: Release v1.1
Branch: find-friends Commit: Added functionality
Branch: find-friends Commit: Improved UI
Branch: add-friends Commit: Added invite friend
Branch: add-friends Commit: Fixed add friend bug
stella
kanav
Feature branch demo with multiple developers
Step 2: Git combines changes made between Closest Common Ancestor and the tips of branches and creates a merge commit
Branch: main
Commit: Release v1.1
Branch: find-friends Commit: Added functionality
Branch: find-friends Commit: Improved UI
Branch: add-friends Commit: Added invite friend
Branch: add-friends Commit: Fixed add friend bug
stella
Branch: main
Commit: Release v1.1
kanav
Feature branch demo with multiple developers
Step 2: Git combines changes made between Closest Common Ancestor and the tips of branches and creates a merge commit
Branch: main
Commit: Release v1.1
Branch: find-friends Commit: Added functionality
Branch: find-friends Commit: Improved UI
Branch: add-friends Commit: Added invite friend
Branch: add-friends Commit: Fixed add friend bug
Branch: main
Commit: Merge find-friends branch
kanav
stella
Branch: main
Commit: Release v1.1
Feature branch demo with multiple developers
Kanav: begins work on review branch
Branch: main
Commit: Release v1.1
Branch: find-friends Commit: Added functionality
Branch: find-friends Commit: Improved UI
Branch: add-friends Commit: Added invite friend
Branch: add-friends Commit: Fixed add friend bug
Branch: main
Commit: Merge find-friends branch
stella
Branch: review Commit: Introduced review categories
kanav
Feature branch demo with multiple developers
Stella: merges add-friends branch into main
Branch: main
Commit: Release v1.1
Branch: find-friends Commit: Added functionality
Branch: find-friends Commit: Improved UI
Branch: add-friends Commit: Added invite friend
Branch: add-friends Commit: Fixed add friend bug
Branch: main
Commit: Merge find-friends branch
stella
Branch: review Commit: Introduced review categories
kanav
Feature branch demo with multiple developers
Step 1: Git identifies Closest Common Ancestor of add-friends and main
Branch: main
Commit: Release v1.1
Branch: find-friends Commit: Added functionality
Branch: find-friends Commit: Improved UI
Branch: add-friends Commit: Added invite friend
Branch: add-friends Commit: Fixed add friend bug
Branch: main
Commit: Merge find-friends branch
stella
Branch: review Commit: Introduced review categories
kanav
Feature branch demo with multiple developers
Step 2: Git combines changes made since the Closest Common Ancestor and…
Branch: main
Commit: Release v1.1
Branch: find-friends Commit: Added functionality
Branch: find-friends Commit: Improved UI
Branch: add-friends Commit: Added invite friend
Branch: add-friends Commit: Fixed add friend bug
Branch: main
Commit: Merge find-friends branch
stella
Branch: review Commit: Introduced review categories
kanav
Feature branch demo with multiple developers
Step 2: Git combines changes made since the Closest Common Ancestor and…
Branch: main
Commit: Release v1.1
Branch: find-friends Commit: Added functionality
Branch: find-friends Commit: Improved UI
Branch: add-friends Commit: Added invite friend
Branch: add-friends Commit: Fixed add friend bug
Branch: main
Commit: Merge find-friends branch
stella
Branch: review Commit: Introduced review categories
kanav
Added findFriends() method to Friend.java
Added addFriend() method to Friend.java
Feature branch demo with multiple developers
Step 2: Git combines changes made since the Closest Common Ancestor and… uh oh … merge conflict
Branch: main
Commit: Release v1.1
Branch: find-friends Commit: Added functionality
Branch: find-friends Commit: Improved UI
Branch: add-friends Commit: Added invite friend
Branch: add-friends Commit: Fixed add friend bug
Branch: main
Commit: Merge find-friends branch
stella
Branch: review Commit: Introduced review categories
kanav
Added findFriends() method to Friend.java
Added addFriend() method to Friend.java
Collaboration on feature branches demo
Initial commit
stella
Collaboration on feature branches demo
Initial commit
Branch: signup Commit: Added functionality
Kanav creates signup branch
kanav
stella
Collaboration on feature branches demo
Initial commit
Branch: signup Commit: Added functionality
Kanav creates signup branch
Kanav pushes signup branch
kanav
stella
Collaboration on feature branches demo
Initial commit
Branch: signup Commit: Added functionality
Kanav creates signup branch
Kanav pushes signup branch
Stella pulls signup branch
Branch: signup Commit: Fixed bugs
stella
kanav
Collaboration on feature branches demo
Initial commit
Branch: signup Commit: Added functionality
Merge signup page branch into main
Branch: signup Commit: Fixed bugs
Kanav creates signup branch
Kanav pushes signup branch
Stella pulls signup branch
Stella merges sign up branch to main
Stella pushes main branch
kanav
stella
General advice with Git
https://xkcd.com/1597/
Pull Requests
Lecture 31, CS61B Spring 2025
Introduction
Agile Development
Review: Git Commands
Git Branching and Merging
Pull Requests
Summary
Main branch
Main branch
Pull requests
Pull requests
Pull requests example
Branch: signup Commit: Basic UI
Kanav pulls signup branch
kanav
Pull requests example
Branch: signup Commit: Basic UI
Kanav pulls signup branch
Kanav opens PR signup branch
kanav
Pull requests example
Branch: signup Commit: Basic UI
Kanav pulls signup branch
Kanav opens PR signup branch
Stella leaves feedback on PR
kanav
Pull requests example
Branch: signup Commit: Basic UI
Kanav pulls signup branch
Kanav fixes Stella’s feedback
Branch: signup Commit: Improved UI
Kanav opens PR signup branch
Stella leaves feedback on PR
Kanav pushes changes to signup branch
kanav
Pull requests example
Merge signup page branch into main
Branch: signup Commit: Basic UI
Kanav pulls signup branch
Kanav fixes Stella’s feedback
Branch: signup Commit: Improved UI
Kanav opens PR signup branch
Stella leaves feedback on PR
Stella approves PR and merges into main
Kanav pushes changes to signup branch
kanav
Writing good PRs
GitHub PR template in Markdown
Code reviews
Key part of pull requests: someone can leave feedback on your code! This is called a code review.
Why Code Review?
GitHub Pull Request Demo
PR description
Reviewer assigned
GitHub Pull Request Demo
Reviewer comments
GitHub Pull Request Demo
Updated PR lines shown in green, removed in red, auto refresh update once pushed!
GitHub Pull Request Demo
Final reviewer comment
PR ready for merge with main
Summary
Lecture 31, CS61B Spring 2025
Introduction
Agile Development
Review: Git Commands
Git Branching and Merging
Pull Requests
Summary
Summary (Git + Jira + Customer)
Assigned ticket in Jira
Communicate with product manager to understand task better
Customer feedback
Summary (Git + Jira + Customer)
2. Second, we talked about git workflows like feature branches to develop these items
Assigned ticket in Jira
Create a feature branch to code and test your changes
Communicate with product manager to understand task better
Merge to main, ready for deployment!
Customer feedback
Use Git version history to understand past work
Summary (Git + Jira + Customer)
3. Third, we discussed how the PR and code review process was key for code quality and releasing to main
Assigned ticket in Jira
Create a feature branch to code and test your changes
Open a new pull request or update an existing one
Communicate with other engineers through a code review
Communicate with product manager to understand task better
Merge to main, ready for deployment!
Customer feedback
Use Git version history to understand past work
Collaboration
Customers
Engineers
Past and future employees
Product managers, designers
You
Summary (Collaboration is key)
Lessons: Collaboration is key. Opportunities to collaborate with customers, product managers, other engineers, and past/future employees exist throughout the process!
Assigned ticket in Jira
Create a feature branch to code and test your changes
Open a new pull request or update an existing one
Communicate with other engineers through a code review
Communicate with product manager to understand task better
Merge to main, ready for deployment!
Customer feedback
Use Git version history to understand past work