gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

Bug/Feat.: Issue handling a zero-commit (but initialised) git repo

Open hazrpg opened this issue 1 year ago • 0 comments

Hi all,

The issue is pretty basic, and easy to replicate. I hadn't realised it had no commits until after I discussed it in the discord.

The problem:

The following error message is presented when a folder is selected for a git repo that has no commits yet.

image

Steps to reproduce:

  1. Create a new folder mkdir gb-test
  2. Open the directory cd gb-test
  3. Initialise git git init
  4. Go to GitButler (version: 0.10.9) and select the new folder gb-test.
  5. See the error above.

I think ideally the error should inform the user that there is a problem because the repo has not yet had any commits made.

Then I think the next best course of action is to offer the user with a way to resolve that e.g.:

  • If they already have files and are staged (or unstaged), ask if they would like to commit any of those.
  • If they don't have any files, ask if they would like a standard .gitignore or README.md file to be included and commited.

Hope this helps. Thanks for your time.

hazrpg avatar Feb 15 '24 15:02 hazrpg