问题描述:
最近和公司里的几个小伙伴合作完成一个小项目,在github上建立了一个organization,并在其中建立了好几个私有的仓库,就像这样:
之后想要将 organization 中的私有仓库添加到 sourcetree 中,方便在本地进行代码管理,但是在连接仓库的过程中遇到了以下问题:
(这里是push操作,是因为我想用本地代码初始化github上的仓库)
git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v OrganizationName master:master
remote: Repository not found.
fatal: repository 'https://github.com/OrganizationName/RepositoryName.git/' not found
Pushing to https://github.com/OrganizationName/RepositoryName.git
完成时带有错误,见上文。
其中最关键的错误信息是:
remote: Repository not found.
问题解决
-
前提
保证sourcetree获得当前github账号的认证权限
工具 -> 选项 -> 验证 -> 账户添加
认证完成后:
-
关键
github中,在sourcetree的认证权限项目中,添加organization项目的认证权限
使用github个人账号打开 settings -> Applications -> SourcetreeForWindows,看到
检查 SourceTree 的权限中,是否具有 Organization认证权限,
这里显示第一个 Organization 具有权限(截图之前已经申请好了)
而第二个需要单独向 Organization 的所有者申请
切换到 Organization 身份,进入到团队项目的 settings -> Third-party access 页面
可以看到,获得认证权限的 Organization 中,有sourcetree项目,并且权限状态为Access
保证上述两项设置正确后,既可以进行正常git管理操作
现阶段 github 真是太好用了
不限量私有仓库数量
不限量私有仓库中的合作者人数
500GB仓库存储空间
2000分钟/月 的 action 操作
参考文档:https://www.geek-share.com/detail/2703764600.html