@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.
Files changed (2) hide show
  1. package/modules/14-gr.sh +4 -3
  2. 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
- git checkout -f -- .
5
+ # 作用于当前目录,丢弃所有本地变更(包括已暂存的)
6
+ git restore --source=HEAD --staged --worktree -- .
7
7
  else
8
- git checkout -f -- "$@"
8
+ # 作用于指定路径,丢弃所有本地变更(包括已暂存的)
9
+ git restore --source=HEAD --staged --worktree -- "$@"
9
10
  fi
10
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/ushell-module-git",
3
- "version": "1.0.62",
3
+ "version": "1.0.63",
4
4
  "description": "Unix like shell module for git.",
5
5
  "main": "index.sh",
6
6
  "repository": {