Check for existing README prior to creation
See original GitHub issueWhen 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:
- Created 5 years ago
- Reactions:1
- Comments:21 (20 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.@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
extensionOtherwise, 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 onlyreadme.md
andreadme
.