oslab

Lab 8

Create a new branch and switch to it, make 3 changes and commit them separately.

git checkout -b demo-branch
vi <file-name>.txt
git add <file-name>.txt
git commit -m "Change 1"
vi <file-name>.txt
git add <file-name>.txt
git commit -m "Change 2"
vi <file-name>.txt
git add <file-name>.txt
git commit -m "Change 3"

Note down the commit hashes of the first and last commits.

git log --oneline

Switch back to the master branch

git checkout master

Cherry pick the last 2 commits from the demo-branch to the master branch.

git cherry-pick <commit-hash-1>^..<commit-hash-2>

Check the log to see the cherry-picked commits.

git log --oneline

LAB 9

HOME