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
11 Deleting Files in Git

Files and directories sometimes outlive their usefulness. You can remove them from your working tree and tell Git to quit tracking them using the git rm command.

This doesn’t remove the file from your repository’s history; it removes it only from your working tree going forward. You can always go back in the history of the repository and see the files or directories that have been removed.

You call git rm and provide it with a filename to tell Git to remove it (or a standard shell pattern—*.php matches all files that end in .php). You don’t have to provide the --, but it’s necessary if you’re trying to remove a file that conflicts with a command-line option. It tells Git that you’re done providing options, and ...

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