2016-09-29 66 views
7

當我嘗試進行推送時,目前出現以下錯誤。CocoaPods/Specs.git的權限被拒絕

git:(swift3) git push --set-upstream origin swift3 
remote: Permission to CocoaPods/Specs.git denied to paul301. 
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': The requested URL returned error: 403 

這一切開始時我從0.36搬到版本1.0.1

我試着重新安裝的CocoaPods,除去項目(worksapce,podfile,莢文件夾,podfile所有的CocoaPods文件。鎖定)並執行新的'pod init',清除CocoaPods緩存和其他許多事情。

這似乎是它試圖推動我的承諾規格回購。我已經注意到「吊艙安裝」已經改變了我的混帳repot指向規格回購:

enter image description here

我Podfile:

platform :ios, '9.0' 

target 'Test' do 
    use_frameworks! 
    pod 'Moya', '8.0.0-beta.2' 
    pod 'iCarousel' 
    pod 'ObjectMapper', '~> 2.0' 
    pod 'Alamofire', '~> 4.0' 
    pod 'FacebookCore' 
    pod 'FacebookLogin' 

end 
+0

那麼爲什麼在'pod install'上改變git'origin'的Cocoapods? – willrichman

回答

10

我有同樣的錯誤我只是改變可可豆莢爲1.0。 1 ...

基本上你origin已更改爲https://github.com/CocoaPods/Specs.git

你可以檢查:

➜ git:(new_version) git remote -vv 
origin https://github.com/CocoaPods/Specs.git (fetch) 
origin https://github.com/CocoaPods/Specs.git (push) 

可以改變這種既可以通過終端或修改文件手動

終端:

git remote set-url origin https://github.com/PSEUDO/NAME_OF_YOUR_GIT.git 

,進入.git\config文件,並更改

[remote "origin"] 
    url = https://github.com/PSEUDO/NAME_OF_YOUR_GIT.git 
    fetch = +refs/heads/*:refs/remotes/origin/* 

[remote "origin"] 
    url = https://github.com/PSEUDO/NAME_OF_YOUR_GIT.git 
    fetch = +refs/heads/*:refs/remotes/origin/* 
+0

頭腦清醒...爲什麼更新可可豆莢會做到這一點令人難以置信。 – Unome

0

因此,原來「吊艙安裝」,實際上確實改變了我的git。如可以在我的混帳配置可以看出,網址變更爲https://github.com/CocoaPods/Specs.git,我改回點給我的混帳回購協議及所有固定

➜ .git git: cd .git 
➜ .git git: cat config 
[core] 
    repositoryformatversion = 0 
    filemode = true 
    bare = false 
    logallrefupdates = true 
    ignorecase = true 
    precomposeunicode = true 
[remote "origin"] 
    url = https://github.com/CocoaPods/Specs.git 
    fetch = +refs/heads/*:refs/remotes/origin/* 
[branch "master"] 
    remote = origin 
    merge = refs/heads/master 
+0

我有同樣的問題,整天帶我去弄清楚!來到這裏確認是否在我的git源代碼上寫了「pod install」或「pod update」以及CocoaPods規範url。 – avance