question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The GitHub Desktop equivalent of `git init` can be easy to miss

See original GitHub issue

Describe 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

  1. $ mkdir desktop-test
  2. $ cd desktop-test
  3. $ github
  4. An Add Local Repository dialog appears with the option to create a repository
  5. Click create a repository
  6. Create a New Repository dialog appears with textbox Name active
  7. Combination of Local Path and Name 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:

image

(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:

image

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:

image

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

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
jcansdalecommented, May 27, 2020

@rafeca here is my proposed fix https://github.com/jcansdale/desktop/pull/1. Happy to submit it upstream if that would help.

1reaction
tidy-devcommented, Oct 7, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Git started and use the Github Desktop app tool
With a standard Git installation, you would do this by issuing a git config command. The GitHub Desktop setup, though, lets you skip...
Read more >
Git Init in Github Desktop Client - YouTube
Create your own repository using the Git Init Command from the Github Desktop Client. ... Your browser can 't play this video.
Read more >
How to Create a Git Repo From Scratch: Git Init, GitHub ...
If you need an answer fast, try navigating to the folder you want to start a Git repo in and run the command...
Read more >
Getting Started with Git and GitHub Desktop - Codecademy
Git allows you to save drafts of your code so that you can look back at previous versions and potentially undo complicated errors....
Read more >
How does Github Desktop integrates with the Git commands ...
It's entirely possible it's just backed onto the libgit2 library. If it's an Electron app, it could use this via Node.js . But...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found