小编Ant*_*elo的帖子

如何不使用git-stash保存进行中的工作?

我在这种情况下有一个git目录:

ProgSoul@PROGSOUL-LENOVO:~/esercizio3_2$ git status
Sul branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   A

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   A

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        B
Run Code Online (Sandbox Code Playgroud)

在这种情况下,我有:

  • 索引中有一个名为A的文件,其中包含字符串“ AA”
  • 我在文件A中修改了“ AAA”,但没有在舞台上添加此更改。所以在工作目录中,我有一个带有字符串“ AAA”的A
  • 未跟踪的空文件B

我的老师希望我暂时中止工作,创建一个BUGFIX文件,提交并恢复以前的状态。

我通过以下命令实现了它:

git stash --include-untracked
touch BUGFIX
git add BUGFIX
git …
Run Code Online (Sandbox Code Playgroud)

git git-stash git-reset git-commit git-branch

5
推荐指数
2
解决办法
1736
查看次数

标签 统计

git ×1

git-branch ×1

git-commit ×1

git-reset ×1

git-stash ×1