Hey! 👋 How're you today? Another "quick how to" article is here. I tell you some useful feature for your productivity with everyday coding and working with
Follow official description:
A gitignore file specifies intentionally un-tracked files that Git should ignore [...]
.gitignore is your best friend, if you're don't want to push personal/environment/etc. files to your team's project repository on GitHub.
Yep, both you and I, copy these lines from project to project, like a mantra:
# OS specific .DS_Store Thumbs.db # IDE .idea/ .vscode/ # Node.js dependencies node_modules/ # Node.js logs *.log # Builds build/ dist/ # ...
And it's normal for all
git beginners. But you can’t be a newbie all your life! It's time to grow and apply the best solution 👇
In this complex world, it's so difficult to find a simple solution, but not for this task! We can define all of this "always copy-pasted lines" to global
.gitignore file on your system.
- First, copy (for the last time, I promise) needed ignoring files and folders to your home directory
$ sudo cat >~/.gitignore_global <<EOL # OS specific .DS_Store Thumbs.db # IDE .idea/ .vscode/ # Node.js dependencies node_modules/ # Node.js logs *.log # Builds build/ dist/ EOL
- Second, add
$ git config --global core.excludesfile ~/.gitignore_global
- Finally, send link to this article to your teammates.
It's enough! Do this once and forget about excess files commits and copy-paste the same lines to
.gitignore forever! 👍
If you want more — write a comment below & follow me. Thx! 😘