2017-01-16 86 views
-2

我的目錄被鏈接到我的gh頁面,並且可以正常工作數週。我刪除了一個名爲.gitfile的文件,但我認爲這是沒有意義的,顯然不是。現在我無法對我的個人資料頁面進行任何更改。我想去我的舊網站murphypicard.github.io並繼續推動更改。我不小心刪除了我的git文件(在原子中,我的文本編輯器)幾小時前

我的目錄名是portfoliopage和我的GH-頁面的URL是murphypicard.github.io

下面是到目前爲止,我已經試過了命令:

~/wdi/portfoliopage (master)$ git remote add origin https://murphypicard.github.io/ 

~/wdi/portfoliopage (master)$ git remote -v 
origin //murphypicard.github.io/ (fetch) 
origin //murphypicard.github.io/ (push) 

~/wdi/portfoliopage (master)$ git remote get-url 
origin //murphypicard.github.io/ 

~/wdi/portfoliopage (master)$ git push -u origin master 
fatal: repository //murphypicard.github.io/' not found 

~/wdi/portfoliopage (master)$ git remote add origin https://murphypicard.github.io/ 
fatal: remote origin already exists. 

~/wdi/portfoliopage (master)$ git remote add origin [email protected]:MurphyPicard/arayaghsizian.github.io.git 
fatal: remote origin already exists. 

~/wdi/portfoliopage (master)$ git push origin master 
fatal: repository //murphypicard.github.io/' not found 

~/wdi/portfoliopage (master)$ git push gh-pages master 
fatal: 'gh-pages' does not appear to be a git repository 
fatal: Could not read from remote repository. 

我也有嘗試set-url沒有運氣。

有沒有辦法將我的提交推送到我的舊gh頁面?

回答

0

編輯.git/config文件並在其中添加正確的遠程URL。

類似下面:

[remote "origin"] 
url = [email protected]:MurphyPicard/arayaghsizian.github.io.git 
fetch = +refs/heads/*:refs/remotes/origin/* 
0

的命令是:

git remote set-url origin [email protected]:MurphyPicard/arayaghsizian.github.io.git 

但是,正如你所看到的,remote repository是空的。

更新:

目前尚不清楚你想要使用遠程倉庫。請轉到您的GitHub page,瀏覽存儲庫並選擇您想鏈接到本地​​存儲庫的存儲庫。

從您對此問題的評論看來,回購是https://github.com/MurphyPicard/murphypicard.github.io。請在瀏覽器中打開此回購頁面,按下名爲「克隆或下載」的綠色按鈕(位於頁面右側),它會顯示您在git remote命令中使用的URL。對於murphypicard.github.io,URL爲[email protected]:MurphyPicard/murphypicard.github.io.git

因此,你的命令應該是這樣的:

git remote set-url origin [email protected]:MurphyPicard/murphypicard.github.io.git 
+0

如果可能的話,我想繼續推動這個:https://murphypicard.github.io/ 我想:遠程Git設置網址起源https://murphypicard.github.io/沒有運氣 –

+0

我試過的東西:''〜〜/ wdi/portfoliopage(master)$ git remote set-url origin [email protected]:MurphyPicard.github.io.git 〜/ wdi/portfoliopage(master)$ git push origin master 錯誤:找不到存儲庫。 致命:無法從遠程存儲庫讀取。 請確保您有正確的訪問權限 和庫中存在。 〜/ wdi/portfoliopage(master)$ git push gh-pages master fatal:'gh-pages'似乎不是git存儲庫 fatal:無法從遠程存儲庫讀取。 請確保您擁有正確的訪問權限 並存在知識庫.''' –

相關問題