- Rebase - Changing the base of your branch
- Completed through lesson 4
- Admin has merged PR in
-
Navigate to your repo if you're not already there
Set-Location C:\GitHub\GitDemo -
Check status to see where you are
git status -
Create a branch to work in
git checkout -b rebaseWork -
Add a file work.ps1 with the following contents:
Get-Content .\todo.txt -
Add, Commit & Push to your fork on GitHub
git push --set-upstream origin rebaseWork -
Check your branch on GitHub
This branch is 1 commit ahead, 2 commits behind jpomfret:masterThis development process took a while, and now it's time to merge in but the upstream codebase has newer changes than you have in your clone.
-
Checkout your master branch
git checkout master -
Pull down the changes to master
git pull upstream master -
Push changes to your repo on GitHub
git push
-
Checkout work branch
git checkout rebaseWork -
Rebase branch from master
git rebase origin/masterFirst, rewinding head to replay your work on top of it... Fast-forwarded rebaseWork to origin/master. -
Force push your changes to your clone
git push --force -
Check GitHub
This branch is even with jpomfret:master