Creating a .gitignore file - How we can use git ignore to prevent adding unwanted files to git

Creating a .gitignore file - How we can use git ignore to prevent adding unwanted files to git

A.gitignore file is a great and simple tool we can use to prevent including unwanted files in a git repository. This file can be used to simply ignore files and directories but also be used to create complex rules and partial rules to ignore select files.

In this video GitGuardian developer advocate, Mackenzie, runs through exactly how to get started with both a local and a global.gitignore file and shows exactly how the file works. This is designed as an introduction so that you have the knowledge to understand more complex uses for the.gitignore files.

What is a.gitignore file 0:00
Creating a.gitignore file 2:09
Ignoring a file in git 3:06
Ignoring a directory 3:49
Ignoring file extensions in git 4:48
Excluding file path 6:09
Adding an exception to.gitingore file 6:49
Ignoring all directories git 7:31
Ignoring partial name 7:40
Creating global.gitignore file 8:28

Who is Mackenzie Jackson?
Mackenzie is a developer advocate with a passion for DevOps and code security. As the co-founder and former CTO of a health tech startup, he learnt first-hand how critical it is to build secure applications with robust developer operations.
Today as the Developer Advocate at GitGuardian, Mackenzie is able to share his passion for code security with developers and works closely with research teams to show how malicious actors discover and exploit vulnerabilities in code.

What is GitGuardian?
GitGuardian is the code security platform for the DevOps generation. With automated secrets detection and remediation, our platform enables Dev, Sec, and Ops to advance together towards the Secure Software Development Lifecycle.