我不小心删除了我的git文件(在原子中,我的文本编辑器)几小时前
问题描述:
我的目录被链接到我的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页面?
答
编辑.git/config
文件并在其中添加正确的远程URL。
类似下面:
[remote "origin"]
url = [email protected]:MurphyPicard/arayaghsizian.github.io.git
fetch = +refs/heads/*:refs/remotes/origin/*
答
的命令是:
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
如果可能的话,我想继续推动这个:https://murphypicard.github.io/ 我想:远程Git设置网址起源https://murphypicard.github.io/没有运气 –
我试过的东西:''〜〜/ 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:无法从远程存储库读取。 请确保您拥有正确的访问权限 并存在知识库.''' –