我是git的新手,没有任何版本控制系统的经验。我在本地开发,我正在寻找一种更简单的方法(比FTP)将文件部署到(LAMP)Web服务器。我很难配置Git(Windows版本2.5),以便在我推送更改时自动更新其当前工作目录。在创建本地仓库,执行第一次提交以及在别名origin
下添加远程位置之后,我完成了以下操作:
ssh user@domain
cd testgit
git init
git config receive.denyCurrentBranch updateInstead
git status
:无需承诺exit
git status
:没有添加但未跟踪的文件git push origin master
步骤8生成一个通知和两个错误:
stdin: is not a tty
fatal: bad config value for 'receive.denycurrentbranch' in config
fatal: Could not read from remote repository
我一直在四处寻找,但我被困住了。我做错了什么?
答案 0 :(得分:4)
首先,你需要在推送之前添加和提交:如果你有未跟踪的文件,那么在你添加和提交之前不会被推送。
其次,“receive.denyCurrentBranch updateInstead”is only for git 2.3+ (February 2015):确保你在服务器端拥有正确版本的git。
git应该单独安装在服务器上吗?我的Windows机器上有git 2.5。我没有在服务器上专门安装任何东西
是的,你也需要在服务器上安装git。