致命错误-重新组织我的Github



我在使用ubuntu 14.04

我一直在尝试重新组织我的github,但遇到了一些错误。我在github上创建了空的repo,并试图用本地磁盘上相同文件夹的所有文件来填充它们。

我经历了以下步骤:

git init Java-Applications
git add -u
git commit -m "Update"

但一旦我进入

git push origin master

我收到

fatal: 'origin' 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.

我如何用我在本地创建的github转发更新我新创建的github转发?

您需要将origin远程设置为GitHub url。

运行以下命令:

git remote add origin (github url)

在以前使用此repo时,您可能不需要执行此步骤,因为克隆origin远程时会为您设置。

一旦你设置了origin,你就可以从GitHub中提取/提取/等等。你可能会与GitHub上的内容不同步,所以如果你对重新定基感到满意,一个保持同步的好方法是:

git fetch
git rebase origin/master

然后,当你准备好推动你的工作时:

git push origin master

这是一篇关于管理遥控器的好文章。

git init用于创建新的回购。由于您正试图将内容添加到已存在的repo中,因此将(空的)远程git clone添加到本地文件夹中会更有意义。当你按下时,遥控器已经在那里了。(现在要做到这一点,你必须删除.git目录——你不能克隆到有目录的目录中。)

或者,你也可以像Jonathan.Brink建议的那样,手工创建远程"原点"。

最新更新