mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 23:28:02 +00:00
Add Stashing Untracked Files to git til.
This commit is contained in:
@@ -9,6 +9,7 @@ I shamelessly stole this idea from
|
|||||||
|
|
||||||
- [Intent To Add](git/intent-to-add.md)
|
- [Intent To Add](git/intent-to-add.md)
|
||||||
- [Staging Changes Within Vim](git/staging-changes-within-vim.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)
|
- [Verbose Commit Message](git/verbose-commit-message.md)
|
||||||
|
|
||||||
## rails
|
## rails
|
||||||
|
|||||||
20
git/stashing-untracked-files.md
Normal file
20
git/stashing-untracked-files.md
Normal 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 ...
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user