Skip to content

Instantly share code, notes, and snippets.

@showaltb
Last active April 2, 2024 01:27
Show Gist options
  • Save showaltb/1ef9e196bc5ae404ef9c to your computer and use it in GitHub Desktop.
Save showaltb/1ef9e196bc5ae404ef9c to your computer and use it in GitHub Desktop.
Handling Gemfile.lock conflicts during "git rebase"

If both the upstream and your feature branch have made changes to Gemfile, you will likely receive merge conflicts on Gemfile.lock when you rebase your feature branch. Don't try to resolve these manually; you'll probably just screw it up. Instead do this:

git checkout --ours Gemfile.lock
bundle
git add Gemfile.lock
git rebase --continue

This ensures that you get a correct Gemfile.lock at each step along the way.

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