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.

Check for existing README prior to creation

See original GitHub issue

When adding an existing local project, choosing to create a new repository, the UI displays an option to Initialise this repository with a README.

This option was selected by default and in a tired state I selected ‘create’. This completely wiped the README.MD file I had spent an hour writing and there doesn’t seem to be a way of recovering this.

Potential solution

Check for existing README.MD file and prompt user if one exists.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:21 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
Daniel-McCarthycommented, Dec 3, 2018

@msftrncs This is a great point.

I have the a branch ready with the previously suggested changes ready for a pull request. I think the warning should be added at a bare minimum since currently the user is not notified whatsoever.

However, if we want to rethink the solution for this I would love to hear what the team thinks on this. If we wanted a confirm/decline dialog we could also have a setting to disable to the dialog (with the default being the dialog enabled, ideally).

Otherwise, if a ReadMe.md file already exists, does the user really have any benefit to initializing the repository with a new ReadMe? It would be fresh and blank, but it does not seem like a substantial convenience. We could disable the check box if a ReadMe is detected and have a message explaining why so as to avoid confusion.

2reactions
Daniel-McCarthycommented, Nov 28, 2018

@outofambit Great! In regards to checking for multiple possible names, regular expressions would be a great way to check for a match regardless of the capitalization combinations, as well as with/without the inclusion of the .md extension

Otherwise, if we didn’t want to use regular expressions for this, setting the string we are checking .toLowerCase() could limit the need to check for lots of variations and leave it to only readme.md and readme.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I test what my readme.md file will look like before ...
I use a locally hosted HTML file to preview GitHub readmes. I looked at several existing options, but decided ...
Read more >
How to Create a Self-Updating README.md for Your GitHub ...
First thing first, to unlock this feature, you need to create a new repository. It needs to be named the same name as...
Read more >
2.2 Git Basics - Recording Changes to the Repository
Let's say you add a new file to your project, a simple README file. If the file didn't exist before, and you run...
Read more >
How to Write a Good README File for Your GitHub Project
Usually it will have instructions on how to install and run the project. It is essential for you as a developer to know...
Read more >
README content | Bitbucket Cloud - Atlassian Support
If you select No, you can still pick Create a README from the repository Source page. Once you have a README, click Edit...
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