untracked working tree file
参考:http://blog.youkuaiyun.com/sheismylife/article/details/7204345
编写脚本自动编译并部署时的注意
如果想在C2上编写脚本自动从S1上获取最新代码时,要注意:
1.首先之前产生的公钥不能设密码,否则每次git pull的时候都会要求输入密码。
2.不要将项目中的编译中间文件提交到S1上,比如CMake工程里面的build目录的文件,Maven工程里面的target目录里面的文件。否则下次在C2等客户端用git pull会报类似于这样的错误:
error: Untracked working tree file 'public/images/icon.gif' would be overwritten by merge.
需要执行下面的命令才能修复:
-
git reset --hard HEAD
-
git clean -f -d
-
git pull