1. 程式人生 > >關於git push heroku master 部署不到 heroku的解決方案

關於git push heroku master 部署不到 heroku的解決方案

一般輸入以下命令便可部署

git init
heroku git:remote -a 你的應用名稱
git add .
git commit -am "init"
git push heroku master

這個過程出錯,一般是報以下兩個錯誤

1.fatal: unable to access 'https://git.heroku.com/myforums123.git/': error setting certificate verify locations:
  CAfile: D:/Git/mingw64/ssl/certs/ca-bundle.crt

  CApath: none


2.Permission denied (publickey).

fatal: Could not read from remote repository.


解決方案:

步驟1.終端輸入ssh-keygen,檢視是否如下圖所示,


若顯示ssh-keygen不是內部或外部命令,則自行配製環境變數,確保輸入ssh-keygen如上圖所示


步驟2.滿足步驟1條件後,進入C:\User\.ssh (或者你直接在C盤 搜尋.ssh檔案)檢視該檔案下是否有以.pub為字尾的檔案

此時有兩種情況,

第一種就是你有這些檔案說明你有公鑰,需要將公鑰上傳到Heroku

第二種就是你沒有這些檔案,你需要新增一個公鑰

第三種就是刪除並新增heroku作為遠端引用

檢視現有的金鑰的方法是:

heroku keys

清除現有的金鑰的方法是:

heroku keys:clear

@第一種情況的解決方案

你需要把你的公鑰上傳到Heroku,進入

heroku keys:add ~/.ssh/id_rsa.pub (如果你已經進入.ssh目錄就不需要寫‘/.ssh’)


然後執行

git push heroku master

(不行的話使用

heroku keys:clear

 清除現有的金鑰,使用第二種情況的解決方案

@第二種情況的解決方案

使用以下命令新增一個公鑰

heroku keys:add

確保SSH檢查正確目錄中的金鑰,執行以下操作:

ssh -vT [email protected]

其中將顯示以下行:

OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to heroku.com [50.19.85.156] port 22.
debug1: Connection established.
debug1: identity file /c/Wrong/Directory/.ssh/identity type -1
debug1: identity file /c/Wrong/Directory/.ssh/id_rsa type -1
debug1: identity file /c/Wrong/Directory/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version Twisted
debug1: no match: Twisted
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Host 'heroku.com' is known and matches the RSA host key.
debug1: Found key in /c/Wrong/Directory/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /c/Wrong/Directory/.ssh/identity
debug1: Trying private key: /c/Wrong/Directory/.ssh/id_rsa
debug1: Trying private key: /c/Wrong/Directory/.ssh/id_dsa
debug1: No more authentication methods to try.

再次執行

git push heroku master

命令應該能正確部署


@第三種情況解決方案:

1.先檢查heroku

git remote -v

如果heroku存在,將其刪除

git remote rm heroku

然後添加回來(注意下,下面這條命令的project,是你的heroku裡面APP的名稱)

git remote add heroku [email protected]:project.git

再次執行下面的命令應該可以成功

git push heroku master

<**********************************完畢*****************************************>

參考連結:

https://stackoverflow.com/questions/4269922/permission-denied-publickey-when-deploying-heroku-code-fatal-the-remote-end

https://stackoverflow.com/questions/28641851/cannot-push-to-heroku-fatal-unable-to-access-could-not-resolve-host-nil-n

https://stackoverflow.com/questions/17626944/heroku-permission-denied-publickey-fatal-could-not-read-from-remote-reposito

https://blog.csdn.net/R3lish/article/details/51972363

相關推薦

關於git push heroku master 部署heroku解決方案

一般輸入以下命令便可部署git init heroku git:remote -a 你的應用名稱 git add . git commit -am "init" git push heroku master這個過程出錯,一般是報以下兩個錯誤1.fatal: unable to

Git總結筆記4-git push origin master 報錯的解決方法

failed 總結筆記 rebase nbsp read hint err ont version 1 錯誤提示如下: 2 [[email protected]/* */ php]# git push -u origin master 3 To [ema

git push origin master報錯,解決方法

今天,用git把原生代碼推送到遠端伺服器上時出現錯誤: [email protected]:/work2/recvdsrc$ git push origin master [email protected]'s password: Counting o

IDEA使用Git出現push to origin/master was rejected錯誤解決方案

reject url all 圖片 ima 解決方案 技術 cte min 在IDEA中配置碼雲的URL,如下圖 切換到自己項目所在的目錄,右鍵選擇GIT BASH Here 在terminl窗口中依次輸入命令: git pull git pull ori

git push origin master 遇到的分支問題

push 但是 提交 ack tro 使用 原因 str 修改 我從master分支創建了一個issue1分支,做了一些修改後,使用git push origin master提交,但是顯示的結果卻是‘Everything up-to-date‘, 發生問題的原因是git

【轉載】push to origin/master was rejected錯誤解決方案

版權宣告:本文為博主原創文章,未經博主允許不得轉載。 https://blog.csdn.net/a137151062/article/details/78820806idea中,釋出專案到OSChina的Git中,當時按照這樣的流程新增Git,然後push,提示:push to origin/master

github中git push origin master出錯:error: failed to push some refs to

由於工作忙的原因,也是自己懶的原因,本來有機會跟git更深入的接觸,確因工作原因與git失之交臂。 今天在github上建立了自己的第一個公共倉庫,然後上傳了第一專案。 github入門到上傳本地專案 在提交遠端倉庫期間遇到一個小問題:  就是本文標題錯誤,查閱資料發現,原來是

git ignore 新增忽略檔案生效解決辦法

前提:有時候我們在Android Studio中修改了Project下的 .gitignore檔案,添加了一些忽略檔案例如: .gradle /local.properties /.idea/wo

push to origin/master was rejected錯誤解決方案 轉載 https://blog.csdn.net/a137151062/article/details/788208

idea中,釋出專案到OSChina的Git中,當時按照這樣的流程新增Git,然後push,提示:push to origin/master war rejected"。 解決方案如下: 1.切換到自己專案所在的目錄,右鍵選擇GIT BASH Here,Id

git push 總是要輸入賬號密碼解決辦法

1、先cd到根目錄,執行git config –global credential.helper store命令 root@iZwz90a11x50xdx5dle0wgZ:~# git config --global credential.helper s

push to origin/master was rejected錯誤解決方案

idea中,釋出專案到OSChina的Git中,當時按照這樣的流程新增Git,然後push,提示:push to origin/master war rejected"。解決方案如下:1.切換到自己專案

Eclipse.Oxygen+Tomcat8.5部署成功解決方法(1)

在Oxygen版的Eclipse上搭建完TomCat8.5,通過eclipse啟動後,總是沒辦法通過localhost:8080去訪問,但是到Tomcat8.5目錄下,通過startup.bat啟動又是成功的。 在eclipse啟動後,console有這樣一個提示: Th

git push origin mastergit push有什麼區別?

開發十年,就只剩下這套架構體系了! >>>   

Zabbix2.4安裝部署、編碼及翻譯準確解決方案

RoCE -m 英漢互譯 tle root dbn 數據庫名 all 安裝位置 本地做yum源[root@localhost /]# tar zxf zabbix2.4.tar.gz -C / 將zabbix2.4解壓到/下[root@localhost /]# crea

Spring配置文件裏xsd找到時解決方案

images ... multi col card 源碼 ota match spring配置 今天導入了大神的Dubbo框架,分析下源碼案例發現報錯: 錯誤: Multiple annotations found at this line: - cvc-compl

XAMPP本地服務器打解決方案

解決 cal 技術分享 http 9.png 成功 .com nbsp amp 第一步:先開啟相關服務:如圖 第二步:在瀏覽器上輸入localhost:端口號,(或127.0.0.1:端口號),按回車,就成功登陸本地服務器。 XAMPP本地服務器打不開解決方案

Win10系統下軟件UI顯示完整解決方案

key 解決 window 顯示不完整 行高 解決問題 存在 路徑 解決方案 方法摘錄如下 step1:打開註冊表 WIN+R,或者運行裏面輸入regedit step2:路徑[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows

sql執行內部操作期間檢測到一致性解決方案

服務 repair false 重啟 html -- 不一致 備註 操作 解決方法:重啟下SQL服務,把下面腳本運行即可。運行後,壞掉的數據庫可能會丟失。 --mydb 為壞了的數據庫名--mytable 為壞了的據庫表--master 這裏不需要更改 use mydb

android studio 開發中啟動android項目報錯sdk版本一致解決方案

技術分享 發現 依賴 adl 目的 clas studio ima 需要 安卓項目開發中新建項目後再run‘的時候發現報錯com.android.support:appcompat-v7依賴報錯 查看下build.gredle所配置的參數: 打開項目的bui

sqlserver數據庫的服務器 改名字後 數據庫登錄解決方案

數據 sql數據庫 問題 解決方法 sqlserve lec 方案 啟動 sys 計算機名稱修改後,sqlserver原來的windows驗證無法登錄標簽: 數據庫2016-09-26 15:04 1491人閱讀 評論(1) 收藏 舉報分類: DB之路——sqlserver