Sublime Forum

Empty commit


How do you do an empty commit from within Sublime Merge? That is, the equivalent of

git commit --allow-empty -m "an empty commit"

One sometimes does this as the initial commit in a blank repository.



I don’t think there’s a direct way to do that out of the box, but you could add it yourself if you want to.

To do that, select Preferences > Browse Packages... from the menu, then go inside the User folder there. This is where all of your customizations to Merge are stored (similar to how it works in Text).

In that folder, create a file named Custom.sublime-commands and put the following content into it, then save the file. The actual name of the file doesn’t matter so long as it is sublime-commands file.

        "caption": "Make empty commit",
        "command": "git",
        "args": {
            "argv": ["commit", "--allow-empty", "-m", "an empty commit"]

Once you save the file, the command will appear in the command palette. It’s executing the git command outlined, which you can change as desired.

1 Like