用于管理 github 中共享存储库上的拉取请求的工作流程

发布于 2024-10-08 19:33:48 字数 1018 浏览 2 评论 0原文

我正在尝试管理我不拥有但具有管理员权限的存储库上的拉取请求。当我尝试从另一个分支中提取更改时,它失败并出现不太清楚的错误。这是我的工作流程...

  1. Fork main repo
  2. 在该 fork 中进行更改
  3. 提交到该 fork
    3.5(转到步骤 2)
  4. 向主存储库提交拉取请求

作为主存储库的管理员,我尝试按如下方式合并这些更改...

  1. git clone [电子邮件受保护]:dude/project.git
  2. git checkout -b gtracy-master master< /code>
  3. git pull http://[电子邮件受保护] /gtracy/project.git master

输入密码后,我收到错误消息...

error: The requested URL returned error: 401 while accessing 
http://[email protected]/gtracy/project.git/ifno/refs

此工作流程是否错误?有没有更简单的方法来管理我自己的拉取请求?

谢谢!

I'm trying to manage a pull request on a repo that I don't own but have admin rights on. When I attempt to pull in changes from another fork, it fails with an error that is less than clear. Here is my workflow...

  1. Fork main repo
  2. Make changes in that fork
  3. Commit to that fork
    3.5 (goto step 2)
  4. Submit a pull request to the main repo

As an administrator of the main repo, I'm attempting to merge those changes as follows...

  1. git clone [email protected]:dude/project.git
  2. git checkout -b gtracy-master master
  3. git pull http://[email protected]/gtracy/project.git master

After entering my password, I get the error message...

error: The requested URL returned error: 401 while accessing 
http://[email protected]/gtracy/project.git/ifno/refs

Is this workflow wrong? Is there an easier way to manage my own pull requests?

Thanks!

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

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

发布评论

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

评论(1

回忆凄美了谁 2024-10-15 19:33:48

GitHub“拉取请求”帮助页面没有提及它,但我更喜欢重新调整我的工作在提交任何拉取请求之前,在原始存储库的分支顶部的分叉中完成。
也就是说,我会将原始存储库添加为远程仓库,获取我的拉取请求最终将应用到的分支,并首先在该分支之上本地(在我的分叉内)重新设置我的工作。
这样我就可以确保我的所有拉取请求都将是快进请求。

但就您而言,如果您知道自您分叉并处理本地存储库以来原始存储库中尚未发布任何更改,则这可能不适用。

对于第二部分,我将遵循“合并拉取请求”部分,并添加您的分叉存储库作为原始存储库克隆的远程版本。

话虽如此,GitHub Smart HTTP 页面中提到了错误 401“未经授权” :

不要忘记 https 部分 - Git 会通过网络发送散列但未加密的密码,因此请务必使用 SSL。
在 Git 的未来版本中(假设我们的补丁已集成),如果未提供用户名,Git 会提示您输入用户名,并且客户端会收到 401,因此您实际上不必将用户名放入 URL - 它只会询问当 Git 需要的时候你就可以了。

因此,如果您想在地址中使用用户名,请尝试使用 https。
或者尝试使用 http://github.com/gtracy/project.git (公共存储库地址)

The GitHub "pull request" help page don't mention it, but I prefer rebasing my work done in a fork on top of the branch from the original repo before submitting any pull request.
That is, I would add the original repo as a remote, fetch the branch to which my pull request will eventually apply, and rebase first my work locally (within my fork) on top of that branch.
That way I make sure all my pull requests will be fast-forwards one.

In your case though, that may not apply if you know that no changes has been published in the original repo since you have forked and worked on your local repo.

For your second part, I would follow the "Merging pull request" part, and add your forked repo as a remote of your original repo clone.

That being said, error 401 "Unauthorized" is mentioned in the GitHub Smart HTTP page:

Don't forget the https part - Git will send your password hashed but unencrypted over the wire, so be sure to use SSL.
In future versions of Git (assuming our patch gets integrated), Git will prompt you for your username if it's not provided and the client gets a 401, so you won't actually have to put your username in the URL - it will just ask you when Git needs it.

So if you want to use the username in your address, try with https.
Or try with http://github.com/gtracy/project.git (public repo address)

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