1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-02 22:58:01 +00:00

Add Stashing Untracked Files to git til.

This commit is contained in:
jbranchaud
2015-02-26 21:07:30 -06:00
parent 612311cba6
commit 973eb974e5
2 changed files with 21 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ I shamelessly stole this idea from
- [Intent To Add](git/intent-to-add.md)
- [Staging Changes Within Vim](git/staging-changes-within-vim.md)
- [Stashing Untracked Files](git/stashing-untracked-files.md)
- [Verbose Commit Message](git/verbose-commit-message.md)
## rails

View File

@@ -0,0 +1,20 @@
# Stashing Untracked Files
Normally when stashing changes, using `git stash`, git is only going to
stash changes to *tracked* files. If there are any new files in your project
that aren't being tracked by git, they will just be left lying around.
You might not want these *untracked* files left behind, polluting your
working copy. Perhaps these files change your projects functionality or
affect the outcome of tests. You just want them out of the way, for the
moment at least.
And so along comes the `-u` or `--untracked` flag.
```bash
$ touch new_file.rb
$ git stash
No local changes to stash
$ git stash -u
Saved working directory and index state WIP ...
```