How to create README file for your git code
What is a README?
A well formatted text file that is used to document important information about your GIT project for any user who starts to use it for the first time.
- Even though GitHub Readme files (typically./readme.md) are Markdown, and although Markdown supports HTML, you can’t put.
- Github gives you multiple choices where it takes it sources from. By default its the root of the master branch, which will use the README.md in case there is no index.html. But you can also switch to the docs/ folder in your repository settings. With that you can put the index.html under the docs/ folder.
- Nov 22, 2020 There are many great README templates available on GitHub, however, I didn't find one that really suit my needs so I created this enhanced one. I want to create a README template so amazing that it'll be the last one you ever need - I think this is it. Here's why: Your time should be focused on creating something amazing.
Generally there is just 1 README.md file per project. But if needed it can also be created for each module in a project.
How to create a README?
Hi, I’m not exactly following you and I’m having the same issue where my project redirects to the Readme file. When I deploy to github pages using ssh and NPM ‘gh-pages’ it wants me to run an ‘npm run deploy’ which runs a build script and places files in a build folder. I generally write things that I'm going to publish on my README file on excel file and save it as csv and import into this tool and copy paste the Generated Markdown and it creates a table that its decent for others to read your instructions. Hope that helps.
Most commonly used format for README files are markdown language. That’s why you see a file extension ‘.md’. markdown language can be thought similar to HTML.
Steps to create a README.md:
When a new git project is created a blank markdown file README.md file is created automatically.
- Open the README.md file using a text editor. You can use text editor like Notepad, notepad++, Sublime etc.
- Edit the file using markdown language. Learn markdown language syntax from here.
- Commit the file to git to see the preview . Alternatively, you can use any editor like Atom, Emacs, Sublime Text, Vim to create and preview the file.
You can also directly open the file in Git UI and edit it using the markdown language. Git UI also has an option to Preview the file .
That’s It !
Sample README File:
Find below the template of a README.md file written using markdown language syntax.
Copy the below to any text editor to begin creating your README.md file.
The output of sample README.md after committing the file in git looks like below.
As git README.md file is created using markdown language, learning some basic markdown syntax can be very useful to style your README.md file.
Learn syntax for the following most commonly used elements in the git README.md
- Text formatting
- List creation
- Code block creation
- Table creation
Bold: To create text as bold enclose it in double stars or double underscore.
Italic : To create text as bold enclose it in single star or single underscore.
**bold** OR __bold__
*Italic* OR _Italic_
bold OR bold
Italic OR Italic
Ordered lists: Markdown syntax for creating numbered list is just by putting numbers in front of each row.
Unordered lists: Bulleted lists can be created using star or dashes.
- Star is used to create a bullet list item
- Item 2
- You can also use Dashes instead of stars
- Parent Item
- Item 1
- Item 2
Backticks are used to create code blocks .For inline code wrap it in single backticks.
`variable a = 20`
For multiline code block : Use spaces for indentation & use 4 backticks for code blocks without indentation:
Tables are created using dashes and pipes. Dashes are used to underline the headers and pipes are used to separate the columns.Check the example below.
Github Readme File Formatting
How To Format Github Readme File
In this article, we learnt what is readme and we also learnt how to create a readme file for your project.
I hope you liked it !