我正在Linux Debian系统上运行 GitLab 6.2,似乎无法通过命令行推送到远程代码库。每次执行 "git push -u origin master" 命令时,都要求输入用户名和密码(已将 origin 添加为 HTTP 远程)。
检查您的远程设置是否使用http/https:
$ git remote -v
origin https://somedomain.com/username/repo.git (fetch)
origin https://somedomain.com/username/repo.git (push)
如果显示的内容如上所示,请尝试使用ssh进行切换:
$ git remote rm origin
$ git remote add origin git@somedomain.com:username/repo.git
您需要将密钥添加到服务器上。 如果您使用的是Linux或Mac,可以按照此tutorial进行操作。