Never Ending Security

It starts all here

Git Rebase

Rebase when you’ve been on a branch for a few days and you know there have been changes to master.

That way, when you do push your branch up for a pull request and code review it can be easily merged in with the master branch.

Assuming you’re on my-feature-branch…

Rebase Commands:
git checkout master
git pull
git checkout my-feature-branch
git rebase master
git push -f

Be sure to run git push -f, not what git is likely to suggest after you run the git rebase master command (git pull).

If you do have the misfortune of pulling changes into the rebase work you did, then you’ll end up with a bunch of recent commits to the master branch, that you’ve already accounted for, in your pull request…

…and you will likely need to delete that branch and recreate it by cherry picking the commits you need.

More info:


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s