Exercise: Git Branching and Merging
#
Exercise 1 Objective- Switch to the test branch and complete additional steps to your algorithm - for example, what if they send you the wrong order?
- Commit your additional work and push the test branch to GitHub
- Finally, we’ll switch to our local main branch and merge in the changes from the test branch to the main branch
#
Steps for Exercise 1Using the PizzaAlgo repo from earlier... In the Command prompt / Terminal:
- Create a new branch named test -
git branch test
git status
- to see if I have any changes yet- Switch to test branch:
git checkout test
- Do some work on test branch and save → add a step 1a for example
git status
- and see that I have modified Algo file in the test branchgit add .
- add those changes to the staging areas for test branchgit commit -m "reworded a step"
- committed those changes to test branchgit push origin test
- pushed test branch to the remote repository (GitHub)git checkout main
- switch to main branchgit merge test
- merge the changes in test branch to the main branch