Info:fatal: could not read Username for 'http://': No suchcentos7 (git作为webhook的常见问题)

开发环境:

             程序员在本地开发完项目, 上传至git(gitlab/ coding/ 码云/ github), 如何让测试服务器自动获取最新的代码?

 

方案:

           使用gitlab 自带的webhook

Info:fatal: could not read Username for 'http://': No suchcentos7 (git作为webhook的常见问题)

 

遇到的问题:

       webhook是 apache(nginx) 触发, 在触发的时候会遇到如下问下:

Info:fatal: could not read Username for 'http://': No suchcentos7 (git作为webhook的常见问题)

 

 

解决方案:

  登录linux的用户必须是 执行webhook文件的用户 (我的是apache)  

在项目的 .git仓库里, 找到 如下文件:Info:fatal: could not read Username for 'http://': No suchcentos7 (git作为webhook的常见问题)

 

修改 改文件如下: 

Info:fatal: could not read Username for 'http://': No suchcentos7 (git作为webhook的常见问题)

 

参考文章: https://blog.csdn.net/ybygjy/article/details/22409739