1.

Git-Ignore

Answer»

At times, there are some files that we might want Git to ignore while commiting. For example, private files or folders containing passwords, APIs etc. These files are user-specific and hence, we can ignore these using the .gitignore.

.gitignore is generated automatically inside the project directory and ignores the files to get committed to the repositories.

How to use the .gitignore?

Follow the below steps to use add the files you want Git to ignore.


  • Open your project directory on your PC.

  • Create a .gitignore file inside it.

  • Inside the .gitignore write the names of all the files you want Git to ignore.

  • Now add the .gitignore in your repository.

Now, if you check the status of your repo, you will see, all the files which were written in the .gitignore file have been ignored.




Discussion

No Comment Found