DEV Community

Discussion on: How to count the number of commits made between 2 commits hashes

Collapse
 
paesibassi profile image
Federico Calore • Edited

You can pass the output of the wc command to sed to remove the any whitespace.
This should work:

git rebase -i HEAD~"$(git rev-list 33b14c62b...33ad6cecf | wc -l | sed 's/ //g')"

Collapse
 
espoir profile image
Espoir Murhabazi

Thanks for this input dear Federico,
Let me try to edit the post