If you regularly use code editors, GUI tools or other programs that automatically create files and folders, you may want to set up a global .gitignore
file which will apply to every repo on your machine. In this lesson, we show how to do that by creating a .gitignore_global
file with the dotfiles in our ~/
root directory, and then link it to all git repos using our global .gitconfig
.
[00:00] If we know that every gitrepo on a machine is going to need to ignore a specific file or folder type, we can create a global .gitignore. To do this, let's first change directories to where we store our doc files, which in this case will be my user root.
[00:14] Next, let's create a .gitignore global file. The name of this file is up to you. This is the convention that GitHub suggests. Let's open this file in our code editor and we can add any file or folder patterns that we would like to ignore in all of our gitrepos. Let's save and close this file and return to our command line.
[00:33] We can run gitconfig -- global core.excludesfile. The path of where we've placed our global gitignore file. When we create new gitrepos, and files or folders that match our patterns in our gitignore are created, Git can ignore them from anywhere on our system.
Thanks for lesson. It's the first one of many I wish to complete after getting the pro subscription. Quality resource for practical use of git, perfect.
You are welcome! Thank you for watching :)
I'm glad :) Thank you.
Perfekt course! Thank you!
It would be really helpful to have some general guidance on a project branching model and best practices on commit messages.
Great course! I look forward for other git tricks
Thank you, I needed this course to refresh my git knowledge ;) and clarify ambiguity.
Thanks for the great course and great effort! Have learned many stuff.