Allow empty commit be created
As a GItKraken user, I would like to avoid the need to resort to use Git command line client to submit empty commit with summary/body/footer messages using syntax such as the following:
git commit --allow-empty -m "summaryText" -m "bodyText" -m "footerText"
Such empty commit allows users to implement CI webhooks that depend upon such empty commit (along with some patterns of annotated commit msgs) to resolve build failures due to some non-conformance of our build rules regarding commit msgs.
Currently, when user has no code changes to commit, GItKraken UI does not allow an empty commit be created, and the commit button is disabled.
Comments: 16
-
13 Jul, '21
Max AWould be nice to see this as a checkbox or something in the commit area to prevent accidental empty commits, but still allow them when needed
-
07 Aug, '21
Ken FoskeyThis is very similar to mine. I am merging two branches. Develop contains all the items in master but in a different order. Occasionally I get conflicts and after resolving conflicts there is NOTHING in the commit. I then have to switch to command line and execute a push and the branch merge appears in GitKraken.
-
11 Nov, '21
Sebastian MWhen resolving all conflicts when merging by "deleting" the files, such that there is nothing to commit anymore, the merge auto-aborts instead of letting you merge with an empty commit. This is quite counter-intuitive, as it is a rather common thing to do.
1 -
23 Jan, '22
D3would be nice to have for triggering deployment
f.e:
git commit --allow-empty -m "Trigger deployment" -
03 Mar, '22
Vladimir VelichkinResolving merge conflicts with an empty commit is exactly the problem I am having. Strange to see this not prioritized higher as this is indeed a very common need.
-
25 Mar, '22
VladSame issue, have to go and do git commit manually.
-
10 May, '22
dsdel+1 for this feature request
-
25 May, '22
Samuel+1, this is essential when resolving merge conflicts by discarding incoming changes.
-
27 Oct, '22
Diego+1 usefull also to trigger pipeline in some special cases
-
02 Nov, '22
Nate BrandeburgI'd like to second this request. Example case in my scenario is a merge with only one conflict (git submodule commit id) and selecting the original version of the file to and marking resolved simply clears the merge from GitKraken but the merge itself is still open with an empty commit. To property sync the branches for git that commit must be pushed and gitkraken simply doesn't allow for that at this moment.
-
06 Jan, '23
Henrik LynbechI got this response from the support:
"GitKraken does not currently support empty commits but we do have an existing feature request to support this that you may note your interest in here."
This is incredible after many years and reaching version 9 of the product, since empty commits often occurs when merging branches in very active repos. We are a dev team of just 8 people and I run into this "missing feature" (which is a clear bug in my view) more than once a week.
The main problem is that when doing a merge that results in an empty commit, GitKraken leaves the git repo in a merging state but does not reflect this state in the UI. That's a bug, guys. Come on. -
09 Feb, '23
Nicolas P.Not sure this is a good idea.
Git commit have a reason : something has changed and need to be recorded for futur references.
There is also a reason why git has a special flag "--allow-empty" : because it's a specific need that not everyone uses.
If you need an empty commit to trigger a CI/CD, perhaps it'll be better to review your process.
As stated "Continous Integration" and "Continuous Deployement" are "Continuous".
So, every commit should trigger the process.
Perhaps having a dedicated "release" branch, or "prerelease" branch would be better.
Like this, you can push on these branch what you have done in "develop" or whatever else branches.
No more "empty commit", juste a plain real commit.
Merge develop into prerelease with summary text : "adding new features XXX and fix XXX in prerelase" -
15 Feb, '23
Axel HeiderThe usecase of triggering CI with empty commits is real for more complex projects, that use multiple repos. This is a simple solution for development branches with almost zero maintenance costs, compared to setting up a dedicated process. Developers may consider such a process a pain, coming from "another guy, who does not have to use it regularly". Having developers use the workaround of a dummy commit pretending not to be a dummy with an artificial change somewhere is actually making things worse.
Anyway, a workaround for now is using the terminal in GitKaken and run a short custom command. Having a tool bar with buttons to trigger such custom commands would be nice... -
20 Apr, '23
gregI second it, if you can do it in the cmd line why not the gui?
1 -
29 Sep, '23
HansIt would be beneficial to include the command `git commit --allow-empty -m "Empty commit message"` in order to initialise Git with an empty commit. Currently, GitKraken mandates the use of its own template repository with README.md. However, if you wish to switch from private to public and perform a hard reset, the initial README will remain. Using `git commit --allow-empty` would be a more streamlined approach.
-
15 Jul, '24
DanielEmpty commits are necessary to be able to solve some merge conflicts. Even if GitKraken doesn't allow them normally, could we please prioritize fixing the merging use case? Committing a merge is basic git functionality that needs to work without resorting to the command line, and this issue has been open for a long time.
5
Here's the merge conflict scenario:
1. Merge branches with a merge conflict on a single file.
2. Resolve the conflict by keeping the local changes, ignoring the remote changes.
3. GitKraken won't let me complete the merge because the file hasn't changed, I'm forced to go to the command line to create a merge commit. This is incorrect behavior, it should allow merging in this scenario.