无法清理存储库。

时间:2015-01-19 19:05:29

标签: git debian

我在回购中。并试图编译软件,但失败了。我再次尝试并发现了这一点: -

$ git-buildpackage --git-ignore-branch
gbp:error: You have uncommitted changes in your source tree:
gbp:error: On branch experimental
Your branch is up-to-date with 'origin/experimental'.
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:   examples/Makefile.am

no changes added to commit (use "git add" and/or "git commit -a")

gbp:error: Use --git-ignore-new to ignore.
然后我做了: -

$git clean -f 

并再次尝试但仍然有相同的修改示例/ Makefile.am错误,为什么?为什么不将它清理干净或将其恢复到原始状态?

1 个答案:

答案 0 :(得分:1)

构建过程似乎修改了跟踪文件examples/Makefile.am

命令git clean -f仅清除未跟踪的文件。它不会将已修改的文件还原到存储库中的上次记录状态。要做后者,请使用

git reset --hard HEAD

删除所有本地更改。 (小心!它会删除你所做的所有更改。)

相关问题