Skip to content

Instantly share code, notes, and snippets.

@aaronice
Last active May 11, 2018 17:51
Show Gist options
  • Save aaronice/d4fbd2aa1ef685d226cc845efb1812ec to your computer and use it in GitHub Desktop.
Save aaronice/d4fbd2aa1ef685d226cc845efb1812ec to your computer and use it in GitHub Desktop.
How to update a pull request

How to update a pull request

Example: (use develop as base branch, upstream is original repo, origin is my own fork repo)

Switch local branch

git checkout develop

Get latest changes from upstream:

git pull -r upstream develop

Update own remote fork

git push origin develop

Switch back to working feature branch

git checkout <my_ feature_branch>

Make changes and add to index

git add <files_change>

Commit changes locally

git commit -m “commit message"

Check recent commits

git log

Interactively squash and clean recent commits history

git rebase -i HEAD~2

Force update remote feature branch

git push -f origin <my_ feature_branch>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment