The GitHub Desktop equivalent of `git init` can be easy to miss
See original GitHub issueDescribe the bug
The dialog that exposes git init
functionality looks exactly the same as the dialog that creates a new repository in a named directory. This can make the git init
functionality easy to miss by someone who is familiar with how the Create a New Repository
dialog works.
When a user attempts to perform a git init
, the contents of the active textbox Name
isn’t actually used (only the disabled Local Path
is used). This is likely to be confusing for new users because they’ll wonder what the field is used for.
Steps to reproduce the behavior
$ mkdir desktop-test
$ cd desktop-test
$ github
- An
Add Local Repository
dialog appears with the option tocreate a repository
- Click
create a repository
Create a New Repository
dialog appears with textboxName
active- Combination of
Local Path
andName
points to.../desktop-test/desktop-test
Expected behavior
- The textbox
Name
is disabled because its contents aren’t being used - The combination of
Local Path
+Name
points to the directory to be initialized - The textbox
Description
is active because it’s the first field that’s actually used
For example:
(Name
has been disabled and Local Path
is showing the parent directory)
Actual behavior
A dialog that looks like it will create new repository in the directory .../desktop-test/desktop-test
appears:
This looks the same as the normal Create a New Repository
dialog, except with the Local Path
disabled.
Here’s the equivalent Create a New Repository
dialog:
Fix proposal
When the create a repository dialog has been displayed to git init
an existing directory:
- Disable the textbox
Name
- Show the parent directory in
Local Path
Additional context
- Question on Community Forum https://github.community/t5/How-to-use-Git-and-GitHub/Github-desktop-and-VS-Code-folders-not-picking-up-changes/m-p/55095/highlight/true#M11619
- Equivalent of “git init” missing? https://github.com/desktop/desktop/issues/2883
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top GitHub Comments
@rafeca here is my proposed fix https://github.com/jcansdale/desktop/pull/1. Happy to submit it upstream if that would help.
Similar issue - #13071, Describe the feature or problem you’d like to solve The option to add and initialize a repository from an existing folder is hidden serveral steps behind “Add local repository”. Before today I didn’t even know that an “Init Repository” dialog exists. I was using a workaround by via the “New Repository…” entry and naming the repo exactly like the existing folder.
Proposed solution Add an “Initialize local repository…” entry to the File menu.