如何在Git上发送拉请求 [英] How to send pull request on Git

查看:95
本文介绍了如何在Git上发送拉请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近从SVN迁移到Git。我们在局域网内的一台机器上建立了一个裸仓库,并克隆在其他机器上。现在,当任何人做出更改和提交时,我们希望他将pull请求发送到裸回购(通过通知或电子邮件或任何其他方式),之后将通过更改并将其放在裸存储库上(与其工作相同GitHub)。



我们是否需要安装任何界面,或者在Git中有一些命令?

解决方案

Git(软件)和GitHub(网络服务)都有一个叫做pull request的概念,不幸的是它们不完全一样。



原生Git



原生Git request-pull 命令有一个很短的手册页面以下的一句话描述:


总结两次提交到标准输出的更改,并在生成的摘要中包含给定的URL。


这是一个相当低级别的命令,可生成适合发布到邮件列表的更改的简短摘要。其他用户可以使用此发送请求中发布的URL手动将更改发送到其自己的存储库。


$ b

GitHub合并请求



使用 GitHub网络服务时,拉取请求是一个功能齐全的交互式协作工具。一个GitHub拉取请求包含:


  • 更详细的描述,不仅仅是个别的提交摘要
  • 通知自动发送给选择观看项目的用户

  • 一个在线评论界面,其他人可以对提议的更改发表评论

  • 讨论评论录制有关提交的对话

  • 对请求进行集中管理,以免丢失



值得注意的是, Linus对于这两个特性的相对效用有他自己的看法。 / p>

结论



上述两个拉取请求功能在精神上相似,但实现完全不同。特别是, git request-pull 命令不能用于在GitHub上创建新的请求。如果你想支持pull request类型的功能,你有几种选择:




  • 使用GitHub。这肯定涉及最少的工作,但如果你的项目不公开,你将不得不支付GitHub来托管一个私有存储库。有些人可能不习惯这种选择。

  • 使用 Gerrit 。 Gerrit是一款可以下载的开源服务器程序,提供了许多类似于GitHub中可用的功能。它非常适合协作代码评论。

  • 使用 git request-pull 和一个邮件列表。使用这种方法需要来自工程师的更多纪律,因为错误或错误处理邮件列表消息很容易。没有与此方法相关的中央问责制。


We have recently migrated to Git from SVN. We have setup a bare repository on one machine in our LAN network and cloned on other machines. Now when anyone do the changes and commits we want that he sends the pull request to the bare repo (by telling or emailing or any other way) after that one will go through the changes and pull it on bare repository (same as it works on GitHub).

Do we need to install any interface or there is some commands in Git itself?

解决方案

Both Git (the software) and GitHub (the web service) have a concept called "pull request", and unfortunately they are not exactly the same thing.

Native Git

The native Git request-pull command has a very short manual page with the following one-sentence description:

Summarizes the changes between two commits to the standard output, and includes the given URL in the generated summary.

This is a fairly low-level command that generates a short summary of changes that is suitable for posting to a mailing list. Other users can use the URL published in this "pull request" to manually pull changes into their own repository.

GitHub Pull Requests

When using the GitHub web service, a Pull Request is a full-featured interactive collaboration tool. A GitHub pull request has:

  • a more detailed description of the changes than just the individual commit summaries
  • notifications automatically sent to users who have chosen to watch the project
  • an online review interface where others can comment on proposed changes
  • discussion comments for recording conversations about commits
  • central management of pull requests so they won't get lost

It is worth noting that Linus has his own opinion on the relative utility of these two features.

Conclusion

The two "pull request" features described above are similar in spirit but completely different in implementation. In particular, the git request-pull command cannot be used to create a new Pull Request on GitHub. You have several choices if you want to support "pull request" type functionality:

  • Use GitHub. This definitely involves the least effort, but if your project is not public you'll have to pay GitHub to host a private repository. Some people might not be comfortable with this choice.
  • Use Gerrit. Gerrit is an open-source server program you can download that provides many features similar to those available in GitHub. It is especially well suited to collaborative code reviews.
  • Use git request-pull and a mailing list. Using this method requires a lot more discipline from your engineers, as it's easy to misplace or mishandle mailing list messages. There is no central accountability associated with this method.

这篇关于如何在Git上发送拉请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆