Skip to content

FAQ

Frequent questions about rebase: when it is safe, how to force push, and whether to rebase before merging.

When is rebase safe?

Only on branches nobody else has pulled. Rule of thumb: rebase only local, unpushed commits.

How to force push after rebase?

git push --force-with-lease, never plain --force. It aborts if the remote has moved.

Rebase vs merge for PRs?

Rebase before opening a PR (linear history for review). Merge with --no-ff for the PR itself if you want an audit trail.

Can I rebase main?

No. Rewriting main breaks every clone. Merge into main.