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
10 Moving Files in Git

Performing tasks such as reorganizing files, changing file formats, and so on, requires that files and sometimes entire directories get moved. git mv handles this for you.

You provide it with two options: the name of the original file and the new name. This works on files, directories, or symlinks—anything Git can track.

You can move files, directories, and symlinks into other directories as well. Provide git mv a directory as the second option, and you’re set.

Git stages the change for you after you call git mv. You must call git commit after git mv to make the move permanent.

git mv won’t overwrite an existing file; it displays an error instead. You can override this behavior by providing --force (or -f ...

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