Relative Content

Tag Archive for gitrebase

Checking a PR’s commits are all descendants of destination branch

In our team we have a requirement for our PRs: they need to be rebased before being merged, in order to achieve a “semi-linear history”. I’m looking for an automated way to evaluate this requirement (we know how to run a script as part of GitHub’s checks, but I need help with the git commands that make the evaluation itself). For now we only need to determine if a rebase is necessary.

Should I use exec in git rebase to modify the repo?

Sometimes I want to make a change to several previous commits and I wonder if using the exec command in a rebase is a good solution. I think the only use of it I’ve seen is to compile or run tests to verify the rebase didn’t introduce broken code.