2

I would like to use git to keep track of some highly volatile, non-critical personal data. I'm the only one accessing the repo, and I do not care much about most of git's features - it's mostly a quick and easy (local and remote) backup plus the rarely used option to revert a file.

Currently, git and Sourcetree ask me to provide a commit message - I have no problem with that when working in a team or on source code, but in this specific use case, it is just not needed and becomes a huge obstacle.
It actually made me chose SVN over git, which I hate.

I would like to be able to disable any prompt for commit messages in Sourcetree, if possible for specific repositories. Committing should be as few clicks as possible. For comparison, it competes to be as quick as using TortoiseSVN directly in the repo directory.

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
mafu
  • 31,798
  • 42
  • 154
  • 247
  • Try a default commit message. This will still open an editor, but the message will be filled in for you: https://robots.thoughtbot.com/better-commit-messages-with-a-gitmessage-template – houtanb Dec 03 '15 at 14:01
  • 1
    I'm not sure how to do this in Sourcetree, but you can use `git commit --allow-empty-message --message ""` to create a git commit with an empty message. I have this aliased to make it more convenient when I don't want a commit message. – Nick McCurdy Dec 03 '15 at 14:41
  • What version of SourceTree are you using? The first time I made a commit with no message, SourceTree asked me whether or not it should continue warning me if the message was empty. – BJ Myers Dec 15 '15 at 19:48
  • @BJMyers I see it, too. Not sure if I was using an older version or just being blind. Could you add that as an answer? – mafu Jan 23 '16 at 11:58
  • @BJMyers Feel free to take the image of my answer and use it in yours, if you want. I'll then delete my answer. – mafu Jan 23 '16 at 12:05
  • @mafu Thanks - I've already checked the box, so I can't get the dialog to appear again. :) – BJ Myers Jan 23 '16 at 17:15

2 Answers2

1

Why SourceTree? Write a script for it.

cd <git_repo>
git add -A
git commit --allow-empty-message --message ""
Msp
  • 2,493
  • 2
  • 20
  • 34
  • In the general case, I would not like to lose the ease of a GUI. Still +1 as this may often be a good solution. – mafu Jan 23 '16 at 12:53
1

When SourceTree prompts you for a commit message, there is an option to prevent SourceTree from asking you again.

Check this box to stop Sourcetree from asking about empty CMs

If you don't get this option, you might need to update to a newer version of SourceTree.

BJ Myers
  • 6,617
  • 6
  • 34
  • 50
  • Why are you duplicating an answer? And too with the same image? – Msp Jan 23 '16 at 18:23
  • @Msp It's all good, I asked him to, as it was his idea. I was just providing an image, and a temporary answer in case he did not read this thread anymore. – mafu Jan 23 '16 at 20:14
  • 3
    What if you have selected 'Don't ask me again' and want to restore to ask again next time? – lucasvc Nov 24 '16 at 09:38