您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
解決sourceTree突然無法推送到一個可讀可寫的公共碼雲(git)項目問題
发布时间:2021-12-23 21:22:09编辑:雪饮阅读()
話説前段時間自己開了一個碼雲的git項目倉庫,權限都是公開讀寫的,之前都是可以推送的,今天突然推送時候出現如下錯誤:"
git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags origin master:master
remote: [31m[session-954d6594] [31mAccess denied[0m[0m
fatal: unable to access 'https://gitee.com/xy220807/workerman-learning.git/': The requested URL returned error: 403
Pushing to https://gitee.com/xy220807/workerman-learning.git
完成时带有错误,见上文。"
大概意思是沒有權限,那麽我上碼雲上確認了,權限是全開的呢。難道我這個倉庫空間滿了,有過這個懷疑,但是忘記排查這個原因,因爲提前發現了,只要本地在命名行模式下生成pub公鈅給碼云,那麽在命令行下是可以push成功的。
pub公鑰放在這裏
後來發現命令行可以了,但是切換囘sourceTree正常模式后仍舊無法推送,那麽這裏可以在如路徑:
C:\Users\Administrator\AppData\Local\Atlassian\SourceTree\userhosts
中將那個郵箱地址替換為你的碼云郵箱地址。
這次主要原因是我一個安卓同事離職了,然後我的電腦配置太低了,特別是硬盤容量爆紅,然後就直接換了這位安卓同事的主機,結果他主機上默認就是他自己的git郵箱賬號信息了。
$ ssh-keygen -t rsa -C "1509272975@qq.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa): xy220807
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in xy220807
Your public key has been saved in xy220807.pub
The key fingerprint is:
SHA256:cOc1kkKAgEzFauUvFrlQtA8Mnd82WIGerWrZDYGA9u8 1509272975@qq.com
The key's randomart image is:
+---[RSA 3072]----+
|++*+..ooo |
|o+o*o. o . |
|. B+= B o + o |
| + *o* B + o . |
|. . =.+ S . |
| + = |
| . * o |
| + E . |
| . |
+----[SHA256]-----+
关键字词:sourceTree,git,碼雲,無法推送,git