没有共同的参考,没有指定; 什么也不做

Noa*_*oah 64 git gitolite

我有一个当地的git项目,我想添加到gitolite.显然这很难,所以我放弃了这个想法.我创建了一个新的gitolite repo,将它添加到gitolite-admin/conf/gitolite.conf并提交并推送更改.然后我git clone git-noah:project-name成功地克隆了新的回购.然后我将除.git之外的所有文件和文件夹复制到project-name文件夹.我做到了,

git add -A
git commit -a -m "Moved to new repo."
git push
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'git-noah:project-name'
Run Code Online (Sandbox Code Playgroud)

Oli*_*ver 175

远程(原始)存储库上尚未存在主服务器.

git push origin master
Run Code Online (Sandbox Code Playgroud)

在第一次推送之后,您可以使用更简单的方法

git push
Run Code Online (Sandbox Code Playgroud)


pir*_*bay 5

如果您收到错误:

No refs in common and none specified; doing nothing.
Perhaps you should specify a branch.
Run Code Online (Sandbox Code Playgroud)

但没有收到错误:

warning: push.default is unset
Run Code Online (Sandbox Code Playgroud)

git commit在尝试运行之前确保您已经运行过git push


Mar*_*tin -4

您的本地和远程存储库不共享相同的历史记录,因为您重新创建了存储库。因此,Git 不会让你推送此内容。

如果您不怕丢失远程存储库上的内容,您可以强制推送:git push -f