@jswork/ushell-module-git 1.0.62 → 1.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/modules/14-gr.sh +4 -3
- package/package.json +1 -1
package/modules/14-gr.sh
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
gr() {
|
|
4
|
-
# 当没有传值的时候,即为 "."
|
|
5
4
|
if [ $# -eq 0 ]; then
|
|
6
|
-
|
|
5
|
+
# 作用于当前目录,丢弃所有本地变更(包括已暂存的)
|
|
6
|
+
git restore --source=HEAD --staged --worktree -- .
|
|
7
7
|
else
|
|
8
|
-
|
|
8
|
+
# 作用于指定路径,丢弃所有本地变更(包括已暂存的)
|
|
9
|
+
git restore --source=HEAD --staged --worktree -- "$@"
|
|
9
10
|
fi
|
|
10
11
|
}
|