git 服务器布置的一些坑
git 仓库push 提示文件已迁出报错
到object.git/.git 下(有congfig 文件)执行
git config --bool core.bare true
push下看能不能成功 如果还不行,执行
git config receive.denyCurrentBranch ignore
======================
git,设置workt_ree,服务器上显示工作文件
hooks 文件加中添加 post-receive 钩子文件(用于自动更新工作目录内容)
touch post-receive
vim post-receive
加入内容
WORK_TREE='../'
git --work-tree="${WORK_TREE}" reset --hard
然后保存
chmod -R 777 post-receive
-------------------------------
git 服务器切换分支错误
提示报错fatal: this operation must be run in a work tree:
服务器项目文件根目录中缺少Readme 文件,
- touch Readme
- git init
- git add Readme
- git commit -m ‘initial commit’ Readm
---------------------------------
浙公网安备 33010602011771号