4 ms·
Creating empty git commits and pushing them to a PR might be all you need to scratch that “let’s just try it once more, without changing anything” itch. Please
by xvinci 4y ago
Creating empty git commits and pushing them to a PR might be all you need to scratch that “let’s just try it once more, without changing anything” itch.
Please just don't. If your CI / CD pipelines do not offer the option to retrigger builds in some way other than modifying the repository, rather spend some time improving them.
I am aware of the "Squash commits" and similar features most CI systems have, but those boxes are easily forgotten. Plus you end up squashing everything and there are valid reasons for having more than one commit in the same PR and keeping them separate
- mst 4y agoThat's absolutely preferable but (a) you might not have done that -yet- (b) you might not be the person with permissions to do that and they might be too busy and/or unwilling to do so. The title of the article does rather make it clear that most of these are "in extremis" rather than everyday techniques.
- isbadawi 4y agoA workaround I've used sometimes to retrigger CI is to do `git commit --amend --no-edit --reset-author`. This changes the sha by changing the author timestamp. Then you can force push it to the PR branch
- akx 4y agoYou don't even need `--reset-author`; the committer timestamp changes without it too: $ git init $ git commit -m hello --allow-empty [master (root-commit) 1177c71] hello $ git commit --amend --no-edit --allow-empty [master (root-commit) 7dcb290] hello