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
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to Git,
- Change the default git branch name from master to main
- [Fixed] Git Clone git@github.com: Permission denied (publickey) Could not read from remote repository Fatal error
- [Solution] fatal: not a git repository (or any of the parent directories): .git
- [fix] zsh: command not found: git
- How to Install Git on Windows
- Setup Git + Visual Studio Code Tutorial
- How to undo last Git Commit on Local Repository?
- Install GitHub Command Line Tool on Mac
- How to Create a Git Branch in 6 Different ways
- Fix Git: Warning: could not find UI helper GitHub.UI on Windows
- Git Config Command - A Deep Dive
- Step-by-Step: How to delete a git branch from local as well as remote origin
- How to Add Git Bash Option to Windows Terminal List
- Command to Clone Repository Using Git Bash
- How to remove or unstage a file from git staged area
- Get the file location of git config values
- GitHub: How to Search Code
- How to check your installed version of Git
- Fix: error: src refspec master does not match any failed to push some refs to Git
- Git: Step-by-Step - How to Push Local Brach to GitHub
- How to Merge Branch into Master Branch
- fix fatal: --local can only be used inside a git repository error
- Fix: Git Pull Error: unable to resolve reference refs/remotes/origin/master: reference broken
- Change the default diff or commit editor for git
- Git Fix: fatal: refusing to merge unrelated histories Error
More Posts:
- [Fix] TypeError: str object is not callable in Python - Python
- WARNING: Python 2.7 is not recommended [macOS Big Sur] - MacOS
- How to update all installed packages at once in Ubuntu - Ubuntu
- Program 11: Calculate Percentage - 1000+ Python Programs - Python-Programs
- How to calculate SUM in Excel on Mac with Examples - Microsoft
- Have you noticed MacOS Ventura About this Mac look like Mac OS X - Mac-OS-X
- MacBook - Time Limit - You have reached your time limit, Ignore Limit - MacOS
- Remove AirDrop Icon from macOS Menu Bar - MacOS