Rebasing | Atlassian Git Tutorial Merge conflicts This makes it easier to navigate your project with commands like git log, git bisect, and gitk. Second, rebasing also results in a perfectly linear project history-you can follow the tip of feature all the way to the beginning of the project without any forks. Why is this useful?įirst, it eliminates the unnecessary merge commits required by git merge.
Once the git pull is complete (and you have resolved any conflicts between the remote/local branches), you can git push the combined changes to the remote branch. Using git pull with pull.rebase will rewrite your local branch history so that commits from the remote branch are applied first, with your local commits applied on top of those changes, as if they occurred after the remote changes.
You need to retrieve those remote changes and combine them with your local changes. Other developers (or automated processes) have committed and pushed some changes to the remote branch. You have committed some changes in your local branch. In my experience this approach results in fewer issues than the default merge option used by git pull. Setting pull.rebase to true tells git to always use the rebase option with git pull instead of the (default) merge option. The -global parameter means that the config will be applied at the global scope (my preference), but you can omit this parameter if you prefer to configure git on a project-by-project basis. These git config settings provide a smoother developer experience when working with the git pull command to combine local and remote changes in your local branch: git config -global pull.rebase true Photo by USGS on Unsplash Table of contents