Git 没有共同的参考文献,也没有指定参考文献;无所事事

Git 没有共同的参考文献,也没有指定参考文献;无所事事,git,gitolite,Git,Gitolite,我有一个本地git项目,我想添加到gitolite中。显然这很难,所以我放弃了这个想法。我创建了一个新的gitolite repo,将其添加到gitolite admin/conf/gitolite.conf并提交和推送更改。然后我用git克隆git noah:project name成功地克隆了新的回购协议。然后,我将除.git之外的所有文件和文件夹复制到项目名称文件夹中。是的 git add -A git commit -a -m "Moved to new repo." git push

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

git add -A
git commit -a -m "Moved to new repo."
git push
我得到这个错误:

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'

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

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

远程(源)存储库中还不存在“main”

git push origin main
在第一次推送之后,您可以使用更简单的

git push
编辑:
根据最近的趋势,我的答案是更新,将“主”替换为“主”

如果您使用git进行镜像,请使用以下方法:

git config remote.backup.mirror true

您的主分支可能位于上游,需要取消设置 论分行行长

您的分支基于“源代码/主代码”,但上游已消失。
(使用
git branch--unset upstream
修复)

您想运行消息中的
git config
语句
git help config
将为您解释它们之间的差异。你可以阅读更多信息。可能的重复事实上,似乎是规范的参考。可能的重复他们绝对共享历史!这是git最棒的事情之一,它知道远程回购中发生的一切,因为你克隆了整个事情。@Enrico检查你推送的分支名称。随着最近的趋势,“大师”一词正在改变。@Oliver,是的,你是对的。有些人更喜欢将“大师”作为“主要人物”。@Tanzeel是的,在2020年,“主要人物”可能是更合适的选择。我最初的答案是在2014年新分支命名讨论之前写的。奇怪的是,main没有工作,给了我refspec错误。。。我不得不把它改成master。这是一份新的github回购协议。