公司存放在git上的仓库一般都是私有的,需要邀请成员进去才能修改,但是个人的一般就随意了,使用Https克隆了一个项目,提交的时候提示需要输入用户名和密码,这时候输入自己git账号的用户名和密码就可以,也可以点击远端 登录,成功看到自己的仓库后表示登录成功。

再次提交,还是报错,提示fatal: unable to access 'https:.git/': The requested URL returned error: 403。表示被拒绝了,接着进入要推送项目的文件下,vim .git/config

[remote "origin"]
url = https://github.com/zezefamily/GitPiPi.git
修改为
url = https://zezefamily@github.com/zezefamily/GitPiPi.git
再push,成功。
网友评论