Skip to content

Instantly share code, notes, and snippets.

@lennykioko
Forked from RuthNjeri/solve_merge_conflicts.md
Last active April 5, 2021 08:23
Show Gist options
  • Save lennykioko/35856e6ffce0fd2dc7602a4152e6c713 to your computer and use it in GitHub Desktop.
Save lennykioko/35856e6ffce0fd2dc7602a4152e6c713 to your computer and use it in GitHub Desktop.

Merge conflicts

Happens when working on a team project when two/more developers have edited the same file.
Therefore, face the conflict courageously.

Assumption: current_branch(local branch) conflicts with a base branch called base-branch

Solving a merge conflict by rebasing

  1. git pull origin --rebase develop. If merge conflicts persist:
  2. Fix merge conflicts by accepting either current changes, incoming changes or Accept both changes
  3. git add . all the changes that you have made.
  4. git rebase --continue to continue fixing merge conflicts.
  5. If merge conflict persists, repeat steps 2 to 4.
  6. If merge conflict is fixed then git push -f current_branch.

Resources to further help

GithubHelp
Atlassian
Gitolite
Hackernoon

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