Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

75%
+4 −0
Q&A What is the point of triggering CI/CD with an empty git commit?

Based on the SO comments, this is not a good general practice, and I believe the point of the posts mentioned in the question is that it can be done (but one probably shouldn't) this can be use...

posted 4mo ago by toraritte‭

Answer
#1: Initial revision by user avatar toraritte‭ · 2023-11-08T13:39:30Z (4 months ago)
Based on the [SO comments](https://stackoverflow.com/questions/68440032/what-is-the-point-of-triggering-ci-cd-with-an-empty-git-commit), this is not a good general practice, and I believe the point of the posts mentioned in the question is that

+ it can be done (but one probably shouldn't)
+ this can be used to test a CI/CD build service/system without having to add a contrived change.

It seems that a good general rule would be to push empty commits only to personal work branches, and remove them before a pull request and/or merging to `master`/`main`.

---

The SO thread [Pushing empty commits to remote][4] asks questions (see below) that would answer this thread, but they have been completely ignored there.

> Are there any disadvantages/consequences of pushing empty commits? Is there any problem I might face in future because of this empty commit??

---

Apparently, there is also the practice of [starting a repo with an empty commit](https://web.archive.org/web/20170919074934/http://bit-booster.com:80/doing-git-wrong/2017/01/02/git-init-empty/). Read the post a couple of times, but still don't understand the reasoning (and I suspect that it is perhaps a satirical post).

  [4]: https://stackoverflow.com/questions/20138640/pushing-empty-commits-to-remote