我遵循了本教程
http://danbarber.me/using-git-for-deployment
我什么都做了,跟着它去喝茶。
我在我的本地计算机上,我对一个文件进行了更改,并且
git commit -a -m "test"然后:
git push然后它要求输入我的服务器密码,因此我输入并得到以下错误:
stdin: is not a tty
Counting objects: 13, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (7/7), 504 bytes, done.
Total 7 (delta 4), reused 0 (delta 0)
remote:
remote: **** Pulling changes into live
remote:
remote: From /var/git/agriTech
remote: * branch master -> FETCH_HEAD
remote: error: Your local changes to 'module/Application/view/layout/layout.phtml' would be overwritten by merge. Aborting.
remote: Please, commit your changes or stash them before you can merge.
remote: Updating 5a53563..7236cb6
To root@217.199.160.153:/var/git/agriTech.git
5b4fafd..7236cb6 master -> master发布于 2013-07-19 03:35:19
我很快地读完了教程。
在服务器上,您在存储库/var/www/myproject (根据教程约定命名)中进行了本地修改。这个存储库不应该直接更新,否则它可能包含未版本化的修改,这不是您想要的。
错误原因:当您执行git push时,/var/git/myproject.git会尝试更新/var/www/myproject,但由于它有本地修改,因此更新失败。
解决方案:
/var/www/myproject并运行git reset --hard HEAD。这将删除所有本地modifications.git push,一切都会正常。为了避免将来出现此问题,您可以在/var/git/myproject.git/hooks/post-update文件中的unset GIT_DIR行之后添加git reset --hard HEAD。
https://stackoverflow.com/questions/17731799
复制相似问题