How to Create & Use GitIgnore File Properly, Quickly & Easily
HTML-код
- Опубликовано: 14 мар 2021
- - How to use gitignore file
- Why we use gitignore file
- What are benefits of gitignore file
- Why gitignore is important
- Which tech stack uses gitignore file
- How to use gitignore generator tool
- How to create gitignore file
- What to do in case of gitignore not working
- Which one is gitignore directory
- How to add files to gitignore
- How to create gitignore file
There is a . before gitignore in the file name. Its like a system file or hidden file. When we use package managers, such as Yarn package manager or npm package manager, we install project dependencies. Project dependencies bring their own dependencies. All of it is kept in a folder called node_modules in case of nodeJS.
Node Modules folder grows with time. Packages or dependencies get old and obsolete as new versions of packages are released. Project uses packages as it needs. Package.json file keeps record of dependencies that we have installed for our project. By using npm or Yarn, we can easily install all dependencies with a single command. Package managers scan package.json file and bring dependencies listed in package.json file. It is easy to install or uninstall packages or dependencies. This means you need node_modules during development and production. If you are not working on a project, it does not need packages, dependencies or node_modules.
If you are not working on a project, it's taking up space in your system. If you have pushed project to github, it will just sit there and won't run. It will not need node_modules or packages while sitting in a repo at github. Almost all of those packages gonna get updates over time. So why keep old packages? Node modules folder can take up considerable hard disk space for a small project. We do not keep packages, dependencies or node_modules in our PC or at Github. We also do not share these. You only need to share or keep your project with package.json file. When you will use your project, just run an npm command to bring back all packages in their latest versions.
So to keep node_modules folder from being uploaded to github or remote repository, we use gitignore file. gitignore file does not just keep node_modules folder from being uploaded but you can also name any other file or folder in it as well. Your project may have other private files like, log files, zip files, database migration files, env file etc. You can ignore all of these files by using gitignore. You can create a gitignore file yourself or there are gitignore tools that can generate boilerplate for any tech stack.
Thank You!
Channel Support
👍 LIKE VIDEO
👊 SUBSCRIBE
🔔 PRESS BELL ICON
✍️ COMMENT
Channel: / webstylepress
Website: www.webstylepress.com
FaceBook: / webstylepress
Twitter: / webstylepress
Instagram: / webstylepress
LinkedIn: / webstylepress
GitHub: github.com/webstylepress
#git #gitignore #nodejs #WebDevelopment #WebStylePress
Thanks a lot, I struggled to find the correct way to implement line!
Thank you for this. Just what I needed. Straight to the point and easy to follow.
Easy to understand and to the point! Thank you : )
Good work man. You made it so easy.
nice. easy to understand! thank you :)
Thanks for this video
learn the purpose of ,gitignore file. thank you
The purpose of gitignore files is to ensure that certain files not tracked by Git remain untracked.
Deam. I understand. I made file copied something inside it. I hope it works.