mohamed@mohamed:~/Projects/skyrocket$ git status
On branch dev/SMMWEB-36
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: config/puppet/modules/apt (new commits)
modified: config/puppet/modules/augeas (new commits)
modified: config/puppet/modules/concat (new commits)
modified: config/puppet/modules/elasticsearch (new commits)
modified: config/puppet/modules/file_concat (new commits)
modified: config/puppet/modules/git (new commits)
modified: config/puppet/modules/php (new commits)
modified: config/puppet/modules/postgresql (new commits)
modified: config/puppet/modules/redis (new commits)
modified: config/puppet/modules/stdlib (new commits)
modified: config/puppet/modules/vcsrepo (new commits)
Untracked files:
(use "git add <file>..." to include in what will be committed)
.idea/copyright/
config/puppet/modules/blackfire/
config/puppet/modules/inifile/
dump.rdb
keys.dev.pub
keys.tags.pub
no changes added to commit (use "git add" and/or "git commit -a")
我不知道(新提交)的含义是什么意思? 我不想提交这些文件。 我试着做
$ git checkout -- .
如果我将config / puppet / *放到gitignore文件中,如下所示更新了缓存
$ git rm --cached -r .
这将从repo中删除这些文件。推或合并其他分支后?
答案 0 :(得分:1)
使用git reset
取消暂存文件!
答案 1 :(得分:0)
使用“git reset”,您可以撤消所有添加 或者使用git reset file_name,您可以撤消选择的添加
答案 2 :(得分:0)
git reset
是从git中取消暂存文件的命令。
取消暂存文件后,您也可以通过git status
命令进行确认。
答案 3 :(得分:0)
如果目录下config/puppet/modules/
是子模块,试
$ git submodule update
答案 4 :(得分:0)
我们可以运行命令git reset --hard
答案 5 :(得分:0)
如果您想保存修改以供以后使用,只需将其隐藏
git add . && git stash save "info for the modification"
。
如果要删除修改,只需执行
git add . && git reset --hard HEAD
附加:
显示您用git stash list
藏匿的东西,应用git stash pop