Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Empty commits are useful to forcefully recreate a pipeline for example in GitLab


You can also rerun a GitLab pipeline using the web UI. That's a lot cleaner than adding empty commits.


100% agree but on certain situations, one doesn't have permissions for retriggering a build from the UI. (Sadly, I've been there)


Yes and no. In case of changes to the runner environment and complex pipeline with many manual jobs, expiring artifacts, etc, it's easier to make an empty commit than to go around deleting what is obsolete and trying to find a working sequence


Empty commits are useful to indicate that lengthy, manually run tests match some prior good state in development branches. For example commits like...

  1.Good
  2.Refactor
  3.Rewrite
  4.Empty with goodness re: 1
  5.Rewrite
  6.Refactor
...and now you retest and something is broken. You have an easy way to isolate any issues as happening after #4. And you have left markers for yourself 6 months from now if something goes wrong after a merge (i.e. confirm 1 and 4 match).


Or

  git commit --amend -C@ && git push -f




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: