When I create a new GitHub repository from my GitHub template, the first git commit message is automatically set to this:
Initial commit
How can I override this? I couldn't find a way to change the initial commit message in the settings.
When I create a new GitHub repository from my GitHub template, the first git commit message is automatically set to this:
Initial commit
How can I override this? I couldn't find a way to change the initial commit message in the settings.
It is possible to do this with a GitHub Action that defines the on.create field like this:
# The workflow will run only when `use this template` is used on: create: See how I managed to do this in my foundry-template project.
git commit --amend. However, according to the GitHub documentation, the event create triggers not (specifically) when a repository is created from a template, but whenever a git reference (branch or tag) is created. How does your workflow not run every time you push a new branch or tag?main branch, and no tags. However, I don't see why this should be a problem anyway, because of the check on line 12, which ensures that the workflow is never run in the template repo itself.As mentioned in the comment by @torek, you cannot change the commit message from GitHub Web app directly, you can do it once you clone it in your system using a cli using git rebase -i --root. You can refer to this video for instructions
Below is the steps you need to follow:
git rebase -i --root pick with reword:wq on your keyboard (to write and quit) and hit Enter :wq on your keyboard git push --force --force.