Skip to content

Commit

Permalink
add functionality to unstage only new files
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Larson <[email protected]>
  • Loading branch information
LucasLarson committed Jan 12, 2023
1 parent c44d8e3 commit 7504bf9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/git-unstage
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ gunstage() {
command git status
;;

--new)
# unstage only new files
command git diff --cached --diff-filter=A --name-only --relative | while IFS='' read -r file; do
command git reset --quiet HEAD -- "${file-}"
done && command git status
;;

-V | --version)
command git --git-dir="$(
command -v -- git-unstage |
Expand Down

0 comments on commit 7504bf9

Please sign in to comment.