gitbutler
gitbutler copied to clipboard
Bug/Feat.: Issue handling a zero-commit (but initialised) git repo
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.
Steps to reproduce:
- Create a new folder
mkdir gb-test - Open the directory
cd gb-test - Initialise git
git init - Go to GitButler (version: 0.10.9) and select the new folder
gb-test. - 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.