問題1 : git push 問題
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags origin refs/heads/master:refs/heads/master
Pushing to https://user@github.com/repo.git
To https://user@github.com/repo.git
= [up to date] master -> master
...
! [rejected] example_tag -> example_tag (already exists)
updating local tracking ref 'refs/remotes/origin/master'
error: failed to push some refs to 'https://user@github.com/repo.git'
hint: Updates were rejected because the tag already exists in the remote.
Completed with errors, see above
解決方案
git pull --tags -f
解決地址: https://github.com/concourse/git-resource/issues/233
問題2 :
每次都提示輸入git@xxx.com 的密碼
解決方案
首先你的ssh公鑰匙已經(jīng)添加gitlab
然后將私有添加在本地的ssh agent 里面,執(zhí)行;ssh-add -K + 私鑰
然后依次執(zhí)行:cd ~/.ssh ; ssh -T +提示輸入名字的git地址進(jìn)行驗證 ;如果輸出 Welcome to GitLab, @git名字! 說明配置成功
驗證:eg:例如項目地址 git@git.aa-zzz.com 可以執(zhí)行 ssh -T git@git.aa-zzz.com , 驗證如果出現(xiàn): Welcome to GitLab, @git名字,說明配置成功
擴展:增加一個ssh http://www.itdecent.cn/p/31cbbbc5f9fa
問題2
[git]Git error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
解決方案
原因是訪問超時時長太短導(dǎo)致
解決方案是增加超時時長 ,執(zhí)行命令:git config --global http.postBuffer 524288000
然后再執(zhí)行:pod install --repo-update ,就可以下載對應(yīng)的文件啦
問題3
忘記ssh私有對的密碼
解決方案
- 進(jìn)入ssh的目錄 2. ssh-keygen -f 私鑰名字 -p 3. 可以重新設(shè)置密碼或一路回車取消密碼驗證
放棄本地沒有add到stage的所有改動
git checkout .
問題4 撤銷上一次commit,還沒有push到遠(yuǎn)程倉庫
git reset --soft|--mixed|--hard <commit_id> git push develop develop --force (本地分支和遠(yuǎn)程>分支都是 develop)
這里的<commit_id>就是每次commit的SHA-1,可以在log里查看到
--mixed 會保留源碼,只是將git commit和index 信息回退到了某個版本.
--soft 保留源碼,只回退到commit信息到某個版本.不涉及index的回退,如果還需要提交,直接>commit即可.
--hard 源碼也會回退到某個版本,commit和index 都會回退到某個版本.(注意,這種方式是改變本地代碼倉庫源碼)
問題5 撤銷上一次commit,已push到遠(yuǎn)程倉庫
問題6: host問題導(dǎo)致 pod install 一直報錯:
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
解決方式:cd 到 管理員/etc目錄在hosts文件添加 13.229.188.59 github.com
問題7:raw.githubusercontent.com 訪問443或者超時或者太慢
方案一:修改DNS
修改你的電腦DNS為Google的8.8.8.8。
[圖片上傳失敗...(image-831ac2-1621245809587)]
點擊這里查看Mac修改DNS教程
方案二:修改代理
此方法僅限于已經(jīng)可以kexue shang wang 的同學(xué)。
在終端中輸入以下命令行(7890 和 789 需要換成你自己的端口):
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:789
再次嘗試連接,應(yīng)該可以了!
方案3:刪除pod/cache 下緩存即可
rm ~/Library/Caches/CocoaPods/search_index.json
問題8: 設(shè)置和取消git代理
設(shè)置ss
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
設(shè)置代理
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
或者
export all_proxy="" http_proxy="" https_proxy=""
取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
或者
export all_proxy="" http_proxy="" https_proxy=""
問題9: Failed to connect to 127.0.0.1 port 7890: Connection refused 或者 curl: (22) The requested URL returned error: 502
原因:本地設(shè)置了不對的代理導(dǎo)致
使用問題的修改方案或者按如下方式修復(fù):
# 方式1:通過git取消代理
$ git config --global --unset http.proxy
$ git config --global --unset https.proxy
#方式2: export方式寫入
export all_proxy="" http_proxy="" https_proxy=""
# 方式2:通過系統(tǒng)命令取消代理
$ unset http_proxy
$ unset ftp_proxy
$ unset all_proxy
$ unset https_proxy
$ unset no_proxy