如何将拉的请求从一个Git服务器迁移到另一台Git服务器的存储库?

发布于 2025-02-10 22:20:30 字数 417 浏览 1 评论 0原文

我使用以下命令将存储库从一个git服务器迁移到另一台。我能够移动标签,但无法移动拉动请求。

git克隆-bare https://github.forex.myrepositoryurl

git Remote Set-url Origin

I am using below commands to migrate the repository from one Git server to another.I am able to move the tags but unable to move the pull requests.

git clone --bare https://github.forEx.myRepositoryUrl

git remote set-url origin [email protected]:Example/myRepositoryUrl.git

git push --all

git push --tags

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夕色琉璃 2025-02-17 22:20:30

您至少需要获取存储这些PR分支的pult/名称空间。

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = https://github.forEx.myRepositoryUrl
    fetch = +refs/pull/*/head:refs/remotes/origin/pr/*

并创建本地分支,供您推回新的存储库。

git fetch
git for-each-ref refs/heads/pull/* --format='%(refname:short)'| \
  while read ref; do \
    git switch pull/${ref} \
  done

但是,现在可能会通过其注释和验证转移实际的拉请求项目。

You would need at least to fetch the pull/ namespace in which those PR branches are stored.

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = https://github.forEx.myRepositoryUrl
    fetch = +refs/pull/*/head:refs/remotes/origin/pr/*

And create local branches for you to push back to the new repository.

git fetch
git for-each-ref refs/heads/pull/* --format='%(refname:short)'| \
  while read ref; do \
    git switch pull/${ref} \
  done

That might now however transfer the actual pull request item, with its comments and validation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文