Skip to content

Git GUI: Selecting Target Directory via "Browse" causes "Location <name> already exists." #820

@andrewd18

Description

@andrewd18

Ran into this issue when trying to teach a new Git user how to clone a repository. The user tried to select an existing, empty folder for the Target Directory, and Git GUI complained. While technically the UI isn't wrong, the process is unintuitive.

Setup

  • git 1.9.5.msysgit.1
  • git-gui 0.19.GITGUI
  • Windows 7 Enterprise, SP1, 64-bit
  • Default install options.

Steps to Reproduce

  1. Create a new folder called "Git Repositories".
  2. Start Git GUI.
  3. Select Clone Existing Repository.
  4. Set the source location to a working, accessible git repository.
  5. For Target Directory, click Browse, navigate to and select "Git Repositories", then click OK.
  6. Click Clone.

Expected:

  • A new folder would be created in "Git Repositories" that matched the name of the Source Location repository.

Actual:

  • Error window appears with the message "Location already exists."

Failed Workaround:

The user attempted the following workaround, which failed with the same error:

  1. For Target Directory, click Browse, navigate to and select "Git Repositories".
  2. Click New Folder.
  3. Give the new folder a name.
  4. Click OK.
  5. Click Clone.

Workaround:

  1. For Target Directory, click Browse, navigate to and select "Git Repositories", then click OK.
  2. In Target Directory, append "/repository_name", where "repository_name" is the folder you want to create.
  3. Click Clone.

Recommended Solution

If the path supplied in Target Directory exists and is a folder, then Git GUI should either:

  • Check if it's an empty folder, and if so, clone there
  • Clone to a subfolder using the source location name (my preference)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions