About
rebase is designed to integrate changes from one branch into another branch.
Example
Imagine this commit history (log) with a remote and a local branch where the commit in the remote branch will be integrated into the local branch.
- A - B - C - D - remote HEAD
\
E - F - G - local HEAD
After a rebase, the commit history (log) will look like:
- A - B - C - D - remote HEAD - E' - F' - G' - local HEAD'
merge is also designed to integrate changes: See What is the difference between a merge and a rebase?
Configuration
Automatic rebase of a branch before a pull request
git config branch.autosetuprebase local