pycharm git工具与coding.net结合

前提:coding.net中的项目是私密项目

问题描述:在使用pycharm自带的git工具clone(或者push)代码时出现 错误如下:

Push failed: Failed with error: unable to access 'https://git.coding.net/xxx.git/': The requested URL returned error: 403

原因:这是由于 私有项目,没有权限,需要输入用户名密码。

解决方法如下:
在.git文件夹下的config文件中远程仓库url添加username:password@,如下

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
[remote "gitbook"]
    url = https://username:[email protected]/alleniverson/mybook.git
    fetch = +refs/heads/*:refs/remotes/gitbook/*

这里还有一个问题就是当用户名使用的是qq邮箱时还是出现上述错误,所以我采用的是另外的登录账户。

你可能感兴趣的:(pycharm git工具与coding.net结合)