- pull latest commit to main branch
git checkout main
# pull latest meta-data
git fetch --all
# bring changes to local branch
git pull
- go back to feature branch
git checkout <feature-branch-name>
- attempt to put main branch changes BEFORE feature branch ones
# make sure the current branch is the feature branch
git rebase main
-
type
git status
to view next action -
(optional) depending on whether or not there was conflict, you might need to resolve merge conflicts
- make code changes in vscode
- go to git tab
- click the refresh button
- make code changes before hitting '+' on the conflicted files
- run
git rebase --continue
upongit status
recommendation
- since the history was changed,
git push
will no longer work, instead use:
# WARNING! This is a potentially destructive action - use with care!
git push --force-with-lease