Gar*_*een 7 git version-control
以下面的场景为例:
.gitignore前git addA - B - C - D - E
| | | |
| \ | /
| commits that accidentally track application config
|
commit to untrack & .gitignore config
[finally you did the right thing... but too late?]
Run Code Online (Sandbox Code Playgroud)
如果你曾经重置或挑选回C,D或E,它将覆盖配置文件.
无论如何通过对它们应用B提交来重写C - E吗?
如果配置文件应该被取消跟踪,最好通过 E 取消跟踪配置文件,将其添加到 gitignore 等进行提交。如果配置包含敏感信息,在这种情况下必须从存储库的任何提交中删除它,那么您就没有权限其他,但修改历史记录(来自 GitHub 的帮助页面讨论了如何执行此操作 - http://help.github.com/remove-sensitive-data/)
由于 Git 的本质和要求,您无法对提交进行更改并使其看起来是相同的提交。
| 归档时间: |
|
| 查看次数: |
304 次 |
| 最近记录: |