Git反转提交错误

时间:2016-04-13 09:24:31

标签: git sourcetree

在SourceTree中,我尝试反转提交,但是我收到了这个错误:

error: The following untracked working tree files would be overwritten by merge:
    sites/default/files/php/twig/.htaccess
    sites/default/files/php/twig/5a28f4da_block.html.twig_7fdf7759ac5e05b56cecaa39f0b0b24227af874948f93eb3bebb14c9aa894bed/.htaccess
    sites/default/files/php/twig/5a28f4da_html.html.twig_a24499b556ded443d175ee53d9f684a5e80725b925c497f5ab92d5181467f3e4/.htaccess
    sites/default/files/php/twig/5a28f4da_page-title.html.twig_91e36ad5fced0c7956bcff8cb739ec0bf4854d46bf202218c344fc3a0d43ff78/.htaccess
    sites/default/files/php/twig/5a28f4da_page-title.html.twig_ae9f32c69b10e2a28019a348c025f0bc6a933c63472f540c10609bc8808faf17/.htaccess
    sites/default/files/php/twig/5a28f4da_page.html.twig_e98316829f88ea4fc6b16b37056f0f3adefa7a60d82af8e5a1df73762808a306/.htaccess
    sites/default/files/php/twig/5a28f4da_region--header.html.twig_c1997eeb08b7d8ff4138be121a639c92134e6e24eed2a368375f02e5602cf34e/.htaccess
    sites/default/files/php/twig/5a28f4da_region.html.twig_2faa3d1db693fe574b3a07bc0abb48f55576718a4c6f82784d91424dc55f0833/.htaccess
    sites/default/files/php/twig/5a28f4da_region.html.twig_311ddf326c3de6a6e9b8316f6f2b88f501e51bf84e82b8fa0d148f094acefd22/.htaccess
    sites/default/files/php/twig/5a28f4da_status-messages.html.twig_450b13c3ebfd7aa08c49fc265d16913f68d48fd1c0e7cb78497196525a8054ed/.htaccess
    sites/default/files/php/twig/5a28f4da_status-messages.html.twig_69862b5840cc89b710bf715ac3450e6a22f228bd791564412fd34ff74af41304/.htaccess
Please move or remove them before you can merge.
Aborting
Completed with errors, see above

如何撤销此提交?

1 个答案:

答案 0 :(得分:1)

您可以使用git clean -f删除这些文件。

您似乎在工作目录中进行了本地更改。您可以git stash当前分支中的本地更改,然后按照。

但是从你提供的消息来看,似乎这些是一些自己更新的日志文件。理想情况下,您应将它们放在.gitignore文件中。

要快速解决问题,您还可以使用git rm --cached sites/default/files/php/twig/,然后结帐。