Skip to content

Commit

Permalink
Amend the readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
meribold committed Jun 18, 2022
1 parent 121ed58 commit 97d5716
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,41 @@ using `git snap`.
Save `git-snap` to some directory in your `$PATH` and make it executable. E.g.:

```bash
curl -f https://raw.githubusercontent.com/meribold/git-snap/v1.0.1/git-snap > ~/bin/git-snap
curl -f https://raw.githubusercontent.com/meribold/git-snap/v1.1.0/git-snap > ~/bin/git-snap
chmod +x ~/bin/git-snap
```

## What gets included in a snapshot commit?

The version of a file that gets committed is always the one in your working tree. Which
files are included depends on whether the file exists in the working tree and the index.
files are included depends on the working tree and the index: only files that exist in
both go into the snapshot commit. In particular:

* If the file exists in both the working tree and the index, it goes into the snapshot
commit.
* If the file doesn't exist in the working tree, it doesn't go into the snapshot commit.
* If the file exists but isn't staged, it **also doesn't** go into the snapshot commit.
* If a file doesn't exist in the working tree, it doesn't go into the snapshot commit.
* If a file is neither tracked nor staged, it doesn't go into the snapshot commit.
* If a file is staged for deletion, it doesn't go into the snapshot commit.

Each row in the following table specifies whether a file exists in any of four trees: the
working tree, the index, `HEAD`, and the tip of the snapshots branch. The last column
indicates whether `git snap` would include this file in the commit it creates. The
version that is included is always the one from the working tree.

| working tree | index | `HEAD` | tip of snapshots branch | description | | effect |
|--------------|--------|--------|-------------------------|-----------------------------------|--------------------|---------------------------------|
| exists | exists | exists | exists | tracked file | :wavy_dash: | updated to working tree version |
| exists | exists | exists | | '' | :heavy_plus_sign: | added to snapshots branch |
| exists | exists | | exists | new file, staged | :wavy_dash: | updated to working tree version |
| exists | exists | | | '' | :heavy_plus_sign: | added to snapshots branch |
| exists | | exists | exists | after `git rm --cached` | :heavy_minus_sign: | removed from snapshots branch |
| exists | | exists | | '' | | |
| exists | | | exists | new file, not staged | :heavy_minus_sign: | removed from snapshots branch |
| exists | | | | '' | | |
| | exists | exists | exists | tracked file, after `rm` | :heavy_minus_sign: | removed from snapshots branch |
| | exists | exists | | '' | | |
| | exists | | exists | new file, staged and then removed | :heavy_minus_sign: | removed from snapshots branch |
| | exists | | | '' | | |
| | | exists | exists | after `git rm` | :heavy_minus_sign: | removed from snapshots branch |
| | | exists | | '' | | |
| | | | exists | after `git rm` and committing | :heavy_minus_sign: | removed from snapshots branch |
| working tree | index | `HEAD` | tip of snapshots branch | description | | effect |
|--------------|--------|--------|-------------------------|-----------------------------------------|--------------------|---------------------------------|
| exists | exists | exists | exists | tracked file | :wavy_dash: | updated to working tree version |
| exists | exists | exists | | '' | :heavy_plus_sign: | added to snapshots branch |
| exists | exists | | exists | untracked but staged file | :wavy_dash: | updated to working tree version |
| exists | exists | | | '' | :heavy_plus_sign: | added to snapshots branch |
| exists | | exists | exists | after `git rm --cached` | :heavy_minus_sign: | removed from snapshots branch |
| exists | | exists | | '' | | |
| exists | | | exists | untracked and unstaged file | :heavy_minus_sign: | removed from snapshots branch |
| exists | | | | '' | | |
| | exists | exists | exists | tracked file, after `rm` | :heavy_minus_sign: | removed from snapshots branch |
| | exists | exists | | '' | | |
| | exists | | exists | untracked file, staged and then removed | :heavy_minus_sign: | removed from snapshots branch |
| | exists | | | '' | | |
| | | exists | exists | after `git rm` | :heavy_minus_sign: | removed from snapshots branch |
| | | exists | | '' | | |
| | | | exists | after `git rm` and committing | :heavy_minus_sign: | removed from snapshots branch |

[1]: https://github.com/meribold/git-snap/commits/snapshots-meribold-smial

0 comments on commit 97d5716

Please sign in to comment.