git - 没有共同的引用,也没有指定;什么也不做

标签 git gitolite

我有一个本地 git 项目,我想将其添加到 gitolite。显然这很难,所以我放弃了这个想法。我通过将其添加到 gitolite-admin/conf/gitolite.conf 并提交和推送更改来创建一个新的 gitolite 存储库。然后我用 git clone git-noah:project-name 成功克隆了新的 repo。然后我将除 .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'

最佳答案

远程(原始)存储库中尚不存在“主”。

git push origin main

在第一次推送之后你可以使用更简单的

git push

编辑: 随着最近的趋势,我的答案已经更新,用“main”替换“master”

关于git - 没有共同的引用,也没有指定;什么也不做,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23528761/

相关文章:

git - 如何在 Heroku 上查看远程 Git 修订版

python - 使用 Ruby/Python 实现远程命令行界面

git - 如何在 Gitolite 配置中为存储库添加描述

git - git 中的 git status -uno 是什么

git - 如何查看 github fork 是否可能比原来的更远?

git - 如何更新远程服务器上的 .git/config

git - 如何在当前 HEAD 和推送中的最新文件之间的预接收 Hook 中获取文件的 git diff?

git - 如何非递归地处理 `git add`?

node.js - 通过 Gitolite 和 post-receive hook 部署 Node 应用程序

git push origin master :refs/heads/master what does this do