首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从公共存储库克隆并推送到私有存储库

从公共存储库克隆并推送到私有存储库
EN

Stack Overflow用户
提问于 2022-06-30 09:01:24
回答 1查看 76关注 0票数 0

我从github克隆了一个公共存储库,做了一些修改,现在我想把它们推到一个私人回购系统上。我所采取的步骤如下:

代码语言:javascript
复制
$ git clone -b dev https://github.com/public_repo
$ cd public_repo
## modify files
$ git add .
$ git status
On branch dev
Your branch is up to date with 'origin/dev'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    new file:   ...
    modified:   ...
    modified:   ...
    ...
$ git commit -m "Now supports new features"
[dev 5f98577c] Now supports Chiplet
 68 files changed, 2855 insertions(+), 1910 deletions(-)
 create mode 100644 ....
$ git remote add private https://private_domain
$ git push private dev
Username for ...
Password for ...
To https://private_domain
 ! [rejected]          dev -> dev (fetch first)
error: failed to push some refs to 'https://private_domain'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

请注意,私有存储库也位于dev分支上。我怎么才能解决呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-06-30 09:16:38

根据错误:您在私有回购dev分支上有不同的代码,并且您试图在不需要拉的情况下推动其他一些更改。请试着在推前拉一下。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72813051

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档