Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| git_add_rm [2019/03/13 14:03] – [git rm and empty directories] rpjday | git_add_rm [2019/03/18 12:29] (current) – [-u, --update option] rpjday | ||
|---|---|---|---|
| Line 152: | Line 152: | ||
| ==== " | ==== " | ||
| - | Stage all changes and deletions of existing files, but not addition of new files: | + | Stage all changes and deletions of existing files, |
| < | < | ||
| Line 255: | Line 255: | ||
| Since Git cannot version empty directories, | Since Git cannot version empty directories, | ||
| + | |||
| + | ===== Accessing deleted files ===== | ||
| ==== Listing all deleted files throughout history ==== | ==== Listing all deleted files throughout history ==== | ||
| Line 281: | Line 283: | ||
| | | ||
| ... snip ... | ... snip ... | ||
| + | </ | ||
| + | |||
| + | ==== Recovering a deleted file ==== | ||
| + | |||
| + | Display the most recent commit that references the file: | ||
| + | |||
| + | < | ||
| + | $ git log -1 -- OUTLINE.txt | ||
| + | commit b86814bf758645cf1d0ea8a6cbfd1486d257f4dc | ||
| + | Author: Scott Chacon < | ||
| + | Date: Tue Oct 14 10:55:34 2014 +0200 | ||
| + | |||
| + | remove changes notes and initial outline | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | Now display its content from the // | ||
| + | |||
| + | < | ||
| + | $ git show b86814bf758645cf1d0ea8a6cbfd1486d257f4dc^: | ||
| + | 1. Getting Started | ||
| + | 1.1 About Version Control | ||
| + | * Local Version Control Systems | ||
| + | * Centralized Version Control Systems | ||
| + | * Distributed Version Control Systems | ||
| + | ... snip ... | ||
| + | </ | ||
| + | |||
| + | You can also: | ||
| + | |||
| + | < | ||
| + | $ git rev-list -n 1 HEAD -- OUTLINE.txt | ||
| + | b86814bf758645cf1d0ea8a6cbfd1486d257f4dc | ||
| + | $ | ||
| </ | </ | ||