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?
Table of contentsClick link to navigate to the desired location
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.

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

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

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

meme code
meme code@memecode
What is immutability and mutability?
19 Jun 07:48

What is immutability and mutability?

meme code
meme code@memecode
What will be the result of adding 10.5 and 10?
23 Jun 13:23

What will be the result of adding 10.5 and 10?

meme code
meme code@memecode
What is the difference between variables that start with @, @@, and $?
23 Jun 14:00

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

meme code
meme code@memecode
What is a function in programming?
24 Jun 18:15

What is a function in programming?

meme code
meme code@memecode
[Fix] extconf.rb failed during the installation of the Ruby library Gosu
27 Jun 16:38

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

meme code
meme code@memecode
Ruby library Gosu for creating 2D games
29 Jun 08:48

Ruby library Gosu for creating 2D games

meme code
meme code@memecode
Gosu Ruby Tutorial - пройдемось по офіційній документації
03 Jul 11:50

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

meme code
meme code@memecode
We are writing a demo game Drones vs Zombies (Gosu / Ruby)
12 Jul 12:17

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

meme code
meme code@memecode
How to fix a Windows crash caused by CrowdStrike?
19 Jul 13:53

How to fix a Windows crash caused by CrowdStrike?

meme code
meme code@memecode
What does .map(&:name) mean in Ruby?
28 Jul 11:18

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

meme code
meme code@memecode
How does the map method work in Ruby? An overview of the method's operation with examples.
30 Jul 07:33

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

meme code
meme code@memecode