跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • Git 如何从自己的仓库提到另外一个仓库
未分類
21 7 月 2020

Git 如何从自己的仓库提到另外一个仓库

Git 如何从自己的仓库提到另外一个仓库

資深大佬 : monetto 6

项目名字叫 app 首先我在我自己的仓库中建立了一个新的 Repository [email protected]:my/app.git

然后我们公司的代码是 [email protected]:company/app.git

我在我们公司的代码上新建了一个分支 my_branch

然后使用这个命令 git remote add myrep [email protected]:my/app.git git push -u myrep

然后现在我想要提交我的 PR 我在我公司的 Web 端没看到提 PR 的选项… 只能从 [email protected]:my/app.git 提交到它本身,刷不出来 [email protected]:company/app.git

现在我想问一下怎么才能从我自己的仓库 [email protected]:my/app.git 提交到公司的仓库 [email protected]:company/app.git

是需要 git remote 添加什么吗

大佬有話說 (9)

  • 資深大佬 : baiyi

    你是想在 compony/app 上提交 my/app 仓库分支的 PR 吗?

  • 資深大佬 : chairuosen

    pr / mr 不是 git 的功能。时 gitlab/github 软件的功能

  • 資深大佬 : chairuosen

    @chairuosen #2 两个项目不能是纯 git 提交两个 remote 的关系,得是网站里的 fork 关系,这样在 mr 的页面里就能看到两个项目了

  • 主 資深大佬 : monetto

    @chairuosen 因为公司自己的 git web 端没有 fork 功能,我就这样做了一下,但是提交合并请求时候就看不见了…这个现在咋办啊 囧

  • 主 資深大佬 : monetto

    @baiyi 对,我自己更新了 [email protected]:my/app.git 的代码,我想提交到 [email protected]:company/app.git ,结果发现 web 端刷不出来 [email protected]:company/app.git 的源。

  • 資深大佬 : chairuosen

    @monetto #4 。。你问你公司的 IT 呀,什么 web 端?

  • 資深大佬 : evilrat

    git remote remove $old_origin;
    git remote add origin $new_repo_url;
    git push origin master –force;

  • 資深大佬 : fxjson

    可以公司的项目上 git add submodule

  • 資深大佬 : baiyi

    @monetto #5 pr 不是 git 的功能,如果你公司用的 git web 存储没有提供就不能用。你可以将 my/app 的分支添加 remote,提交到 compony/app,然后在 compony/app 中提交 pr

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具