Sunday, November 25, 2018

How to create .gitignore in your project root directory

If you create a file in your repository named .gitignore, Git uses it to determine which files and directories to ignore, before you make a commit.

A .gitignore file should be committed into your repository, in order to share the ignore rules with any other users that clone the repository.

GitHub maintains an official list of recommended .gitignore files for many popular operating systems, environments, and languages in the github/gitignore public repository. You can also use gitignore.io to create a .gitignore file for your operating system, programming language, or IDE.

1. Open Visual Studio Code
2. Right click on project Explorer
3. Click New File
4. Name the file as .gitignore
5. Double click the file and open it
6. Enter enter the folder or file type which you want to ignore while checkin
7. Save changes

Done!!!

Reference:
https://help.github.com/articles/ignoring-files/
https://github.com/github/gitignore

No comments:

Post a Comment