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.

application should block adding a bare repository

See original GitHub issue

Description

So when I try and create a new repository in a directory that includes a bare repository, the app recognizes that the directory includes a git repository and asks me to add it instead. So far so good until I add the repository and the app tries to perform a git operation (I don’t know which one exactly) and fails with “fatal: This operation must be run in a work tree”.

Version

  • GitHub Desktop: 1.1.0
  • Operating system: Windows 10

Steps to Reproduce

  1. Add a bare repository.

Expected Behavior

The app rejects adding it since it does not have a working tree or offers to do a local clone.

Actual Behavior

The app adds it and fails to do a git operation repeatedly till the repo is removed.

Additional Information

So I looked at how the app decides if a path is a git directory. I understand how rev-parse --show-cdup is useful but it does not care if the repo is bare or not. I also tried to put a path into the url field of clone and the app complained that the destination already exists. I feel local clones is an enhancement that should be added as well.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Daniel-McCarthycommented, Aug 18, 2018

I would be interested in attempting to implement this functionality if it is not of immediate urgency.

I have already started looking into it. I have added a function that uses the git rev-parse --is-bare-repository command to detect if the repository is bare. However, the part I need some direction on is reporting the error to the user.

From what I can tell this dialog does not display errors like the Publish Repository dialog does. Should this be implemented first, or should we display the error as a pop-up of sorts?

1reaction
shiftkeycommented, Aug 14, 2018

For future reference, if we find ourselves supporting bare repositories in the app in the future:

However, I have GitX installed, and it makes bare foo.git repos into a package, so we might need to add that back in if we start supporting bare repositories.

This will affect dragging-and-dropping the bare repository onto the Desktop tray icon in macOS, see #5207 for the current implementation of this support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bare Repositories in Git - GeeksforGeeks
Repositories in Git are a snapshot of the folder in which you are working on your project. You can track the progress and...
Read more >
What is a Bare Git Repository? – DEVOPS DONE RIGHT - Blog
Now talking about a Bare Repository, it is simply initialized by using git init --bare command. No commits can be made in a...
Read more >
How do you use "git --bare init" repository? - Stack Overflow
Bare repository is the one that has no working tree. It means its whole contents is what you have in .git directory. You...
Read more >
Quick web deployments using git-bare repositories
A bare repository is a git repository that doesn't contain the working tree. It only consists of the repository data. It basically means,...
Read more >
The Bare Repo Approach to Storing Home Directory Config ...
(The url for your Git repo should be assigned to or substituted for ... pushing files into an empty repository, then you will...
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