Skip to content

Commit 58a4b7c

Browse files
committed
git ls-files to show tracked and untracked files
1 parent 309397e commit 58a4b7c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
* [Apply any stash without deleting from the stashed list](https://github.com/git-tips/tips#apply-any-stash-without-deleting-from-the-stashed-list)
3535
* [Apply last stashed state and delete it from stashed list](https://github.com/git-tips/tips#apply-last-stashed-state-and-delete-it-from-stashed-list)
3636
* [Delete all stored stashes](https://github.com/git-tips/tips#delete-all-stored-stashes)
37+
* [Show all tracked files](https://github.com/git-tips/tips#show-all-tracked-files)
38+
* [Show all untracked files](https://github.com/git-tips/tips#show-all-untracked-files)
3739

3840
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
3941
<!-- @doxie.inject end toc -->
@@ -221,5 +223,15 @@ __Alternatives:__
221223
git stash drop <stash@{n}>
222224
```
223225

226+
## Show all tracked files
227+
```sh
228+
git ls-files -t
229+
```
230+
231+
## Show all untracked files
232+
```sh
233+
git ls-files --others
234+
```
235+
224236
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
225237
<!-- @doxie.inject end -->

tips.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,13 @@
126126
"title": "Delete all stored stashes",
127127
"tip": "git stash clear",
128128
"alternatives": ["git stash drop <stash@{n}>"]
129+
},
130+
{
131+
"title":"Show all tracked files",
132+
"tip":"git ls-files -t"
133+
},
134+
{
135+
"title":"Show all untracked files",
136+
"tip":"git ls-files --others"
129137
}
130138
]

0 commit comments

Comments
 (0)