Created
April 2, 2013 12:13
-
-
Save ferventcoder/5291763 to your computer and use it in GitHub Desktop.
Rebase Concept
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rebasing is another way to interact with a remote repository. | |
What it does is take your changes, not yet on the remote, and pulls them off to the side. | |
Then it puts all of the changes in the remote on your repository. After that it puts | |
your changes after the changes from the remote. | |
This results in less merge errors because you are putting your work at the end. | |
What does it look like? | |
git fetch | |
git rebase origin/master | |
As opposed to: | |
git pull | |
Which is just a shortcut to: | |
git fetch | |
git merge | |
Lets create a shortcut for us: | |
git config --global alias.rpull "!git fetch && git rebase origin/master" | |
Now we can just: | |
git rpull | |
In short, there is no more work. You still have to merge, but it's less often. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment