Verifying and Publishing A Backported Change: Homework 4
Verifying and Publishing A Backported Change: Homework 4
Verifying and Publishing A Backported Change: Homework 4
Backported Change
Homework 4
Git Example
Project
games: pacman.c, pacman.h, README
tree
size
blob
5b1d3
README
blob
911e7
pacman.c
blob
cba0a
pacman.h
What Is a Branch?
A pointer to one of the commits in the repo
(head) + all ancestor commits
When you first create a repo, are there any
branches?
Default branch named master
Where Is Master?
master
master
New Branch
Creating a new branch = creating new pointer
git branch testing
Where is new branch created?
Current commit
New Commit
What happens if we make another commit?
345f5
Why Branching?
Experiment with code without affecting main
branch
Separate projects that once had a common
code base
2 versions of the project
Homework 4
Publish patch you made in lab 4
Create a new branch quote off of version 3.0
Branch command + checkout command (git branch quote v3.0; git checkout quote)
git checkout v3.0 -b quote
Use patch from lab 4 to modify this branch
Patch command
patch pnum < quote-3.0-patch.txt
Commit changes to the new branch
git add .
git commit am <Changelog entry>
Generate a patch that other people can use to get your changes
git format-patch -[num] --stdout > formatted-patch.txt