线上项目git库会需要多个用户操作一个库, 部署人员、开发者 分别有自己的账号 部署人员主要是切换tag, 开发者可能需要在线上做调试会需要切换branch和tag还有pull等操作. 但会报错误.
用户有两个-user1 user2
先使用user1 git clone 这个时候用这个用户git fetch pull chekcout 操作都是正常的.
然后切换到用户 su user2 做下面操作就会报错.
$ git checkout v1.0.0
fatal: Unable to create ‘/home/test/sample/.git/index.lock’: ????
$ git pull
error: 无法打开 .git/FETCH_HEAD:????