在GitLab CE中创建新项目并使用以下命令将PC上的存储库推送到该项目后:
git push --mirror origin
我有很多错误,比如
(deny updating a hidden ref)
遥控器是企业GitLab。它存在并且可以访问
origin ssh://git@... (fetch)
origin ssh://git@... (push)
我通过在我的文件系统上创建一个目录并在其中运行来模拟远程:
git init --bare
将此目录添加为远程,将其命名为local
,并使用此远程重试初始推送:
git push --mirror local
而且它起作用了。所有的分支都被复制。那么,推送到公司遥控器有什么问题呢?GitLab中的存储库不是用git init --bare
创建的吗?是否需要一些设置?
GitLab在项目页面上推荐的命令如下:
Push an existing Git repository
cd existing_repo
git remote rename
origin old-origin
git remote add origin ssh://...git
git push -u
origin --all git
push -u origin --tags
但他们似乎只推动当地的分支机构。这是不是意味着我必须做:
git checkout -b branch1 other_remote/branch1
对于other_remote
中的每个分支,使其成为本地分支,然后使用GitLab项目页面中建议的命令将其推送到公司远程?这有点乏味..。
发布于 2020-04-15 13:59:13
以in here身份检查您的本地配置git config --local -l
如果您看到:
push = +refs/heads/*:refs/remotes/origin/*
它应该是
push = +refs/heads/*:refs/heads/*
https://stackoverflow.com/questions/61208056
复制相似问题