我已经使用此命令启动了一个容器(git服务)...
# Create local directory for volume.
$ mkdir -p /var/gogs
# Use `docker run` for the first time.
$ docker run --name=gogs -p 10022:22 -p 10080:3000 -v /var/gogs:/data gogs/gogs
我能够启动git服务,并可以从浏览器中检查新创建的存储库...
http://52.201.82.96:10080/shantanuo/testme
但是,当我按照以下步骤操作时,我得到一个错误(权限被拒绝):
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin http://localhost:3000/shantanuo/testme.git
git push -u origin master
是 docker 问题吗?
最佳答案
由于docker端口3000已链接到主机的10080,请使用此...
git remote add origin http://52.201.82.96:10080/shantanuo/testme.git
关于git - 无法将文件推送到远程主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36712775/