All original content is created in Ukrainian. Not all content has been translated yet. Some posts may only be available in Ukrainian.Learn more

How to make an empty git commit?

Post cover: How to make an empty git commit?
This content has been automatically translated from Ukrainian.
Making an empty git commit. Everyone has their own goals for this action. In my case - to trigger CI.
git commit --allow-empty -m "Your commit message"
In the working branch, you will most likely write the text in English, so:
git commit --allow-empty -m "Trigger Build"
Note the flag --allow-empty, it is what does the magic and allows you to make a commit without code changes.
And after that, you can push the code to remote:
git push origin main
main is the branch where the push will be executed. Also, read what origin means at the link if you don't know yet.

Why might an empty commit be needed?

Usually, it is needed to provoke (trigger) CI or some hook. That is, to run or test the launch of integrations, hooks, scripts, etc., without changes in the code. So you don't need to make any change in the code, for example, adding an empty line or some comment, to make a push.
Like it?React
🧵

This post doesn't have any additions from the author yet.

What is a commit in the context of programming and SCM / Git?
Aug 21, '24 21:37

What is a commit in the context of programming and SCM / Git?

How to remove the .DS_Store file from a Git repository?
Aug 2, '24 19:34

How to remove the .DS_Store file from a Git repository?

Ruby library Gosu for creating 2D games
Jun 29, '24 08:48

Ruby library Gosu for creating 2D games

Gosu Ruby Tutorial - пройдемось по офіційній документації
Jul 3, '24 11:50

Gosu Ruby Tutorial - пройдемось по офіційній документації

[Fix] extconf.rb failed during the installation of the Ruby library Gosu
Jun 27, '24 16:38

[Fix] extconf.rb failed during the installation of the Ruby library Gosu

What is a function in programming?
Jun 24, '24 18:15

What is a function in programming?

We are writing a demo game Drones vs Zombies (Gosu / Ruby)
Jul 12, '24 12:17

We are writing a demo game Drones vs Zombies (Gosu / Ruby)

What is the difference between variables that start with @, @@, and $?
Jun 23, '24 14:00

What is the difference between variables that start with @, @@, and $?

What will be the result of adding 10.5 and 10?
Jun 23, '24 13:23

What will be the result of adding 10.5 and 10?

How to fix a Windows crash caused by CrowdStrike?
Jul 19, '24 13:53

How to fix a Windows crash caused by CrowdStrike?

What is immutability and mutability?
Jun 19, '24 07:48

What is immutability and mutability?

What does the error 'is out of range' mean in Ruby on Rails? Range Error - Integer with limit 4 bytes
Jun 13, '24 07:18

What does the error 'is out of range' mean in Ruby on Rails? Range Error - Integer with limit 4 bytes

What does .map(&:name) mean in Ruby?
Jul 28, '24 11:18

What does .map(&:name) mean in Ruby?

How does the map method work in Ruby? An overview of the method's operation with examples.
Jul 30, '24 07:33

How does the map method work in Ruby? An overview of the method's operation with examples.