Github:似乎不是一个git存储库

时间:2015-10-21 00:11:28

标签: git repository

我需要为自己的github帐户创建一个新的遥控器。但是当我尝试输入下面的代码时,它会给出错误。

pushpika@pushpika-CodeMe MINGW32 ~/codezeroplus-1.0 (master)
$ git fetch pushpika@work 
fatal: 'pushpika@work' does not appear to be a git repository
fatal: Could not read from remote repository

Please make sure you have the correct access rights and the repository exists.

我现在需要做什么?

2 个答案:

答案 0 :(得分:2)

如果您尝试添加远程存储库,则需要先执行远程添加。该命令的基本结构是:

git remote add [shortname] [url]

如果您已完成此步骤并且仍遇到问题,则应在提取中仔细检查shortnameurl。使用git remote -v命令列出Git存储的短名称和URL配对。例如,

$ git remote -v
origin  https://github.com/schacon/ticgit (fetch)
origin  https://github.com/schacon/ticgit (push)

有一个简写的“origin”及其相应的推送和提取URL。

检查以确保您的速记(我假设您尝试使用“pushpika @ work”的方式)已正确配置和/或使用完整的URL访问您的存储库。

PS。 2.5 Git Basics - Working with Remotes文档中提供了有用的说明。有关详细信息,请查看“添加远程存储库”部分。

答案 1 :(得分:0)

从你的问题来看,我认为你需要重新开始。至少要确保你已经完成了前提条件。跟着你,你将全部设置为push , pull , branch , stash ....etc

首先进行初始设置以连接上游。

git config --global user.name "YOUR NAME"


git config --global user.email "YOUR EMAIL ADDRESS"

您可以在此处阅读更多内容github DOC

.COM 然后,您需要转到gihub并创建一个新的存储库。

创建新项目后,它将具有克隆URL。有点像这样#34;你需要将你本地的链接与遥控器" :

git@github.com:mike/blah.git

在本地执行以下操作:

CD =>导航到项目文件夹
并运行以下命令:

git init


git add .
# Adds the files in the local repository and stages 
#them for commit. To unstage a file, use 'git reset
#HEAD YOUR-FILE'.

git commit -m "First commit"
# Commits the tracked changes and prepares them to be pushed to a
#remote repository. To remove this commit and modify the file,
#use 'git reset --soft HEAD~1' and commit and add the file again.      


git remote add origin remote repository URL
# Sets the new remote



git push origin master
# pus to remote . 

还有其他方法可以做到这一点。但是,现在这是获取git之前最简单的方法。 。

相关问题