At times you may want to manually initiate and trigger a build to generate an artifact or kick-start a workflow but it only works when a code commit happens.
If you do not have anything to commit to your git repo, in such cases usually a hack people do is to change a code file (such as a comment line) and add to the staging area and commit-push.
Clean way to perform an empty commit
Make use of the flag --allow-empty with the git commit command,
Example:% git commit --allow-empty -m "Empty commit"
[main 549a3bf] Empty commit
% git log --oneline
549a3bf (HEAD -> main) Empty commit
6ac92d6 4th commit
06250f0 3rd commit
2712514 2nd commit
a3e24f4 1st commit

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!