Skip to Main Content
Pragmatic Guide to Git
book

Pragmatic Guide to Git

by Travis Swicegood
November 2010
Beginner content levelBeginner
160 pages
2h 50m
English
Pragmatic Bookshelf
Content preview from Pragmatic Guide to Git
8 Ignoring Files

Software projects generate a lot of cruft. Some of it you don’t need to commit. For example, I do a lot of work in Python, which leaves a ton of .pyc files laying around, and I edit using MacVim, which creates a swap file for each file that you’re editing. We don’t need or want these files cluttering up our repository or showing up in git status. That’s where the .gitignore and friends comes in.

Each line of the .gitignore is scanned, and any matches it finds are ignored by Git. Your .gitignore file is inside your repository, so you can track it like any other file. You can put it at the top level of your repository, and in that case the rules cascade through all subdirectories. You can also use subdirectory-specific

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pragmatic Version Control Using Git

Pragmatic Version Control Using Git

Travis Swicegood
Git Version Control Cookbook - Second Edition

Git Version Control Cookbook - Second Edition

Kenneth Geisshirt, Emanuele Zattin(EUR), Aske Olsson, Rasmus Voss
Git for Programmers

Git for Programmers

Jesse Liberty

Publisher Resources

ISBN: 9781680500028Errata