git 我可以对 GitHub 上的要点提出拉取请求吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8758612/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 06:19:17  来源:igfitidea点击:

Can I make a pull request on a gist on GitHub?

gitgithubgistpull-request

提问by Razvan Caliman

Can I make a pull request on some else's gist on GitHub?

我可以在 GitHub 上对其他人的要点提出拉取请求吗?

I'm aware of the fork, clone and commit workflow for a gist I own. I'd like to know if I can request to update someone else's gist with my fork.

我知道我拥有的要点的分叉、克隆和提交工作流程。我想知道我是否可以要求用我的叉子更新其他人的要点。

采纳答案by Kevin Sawicki

You cannot currently open a pull request on a Gist.

您当前无法在 Gist 上打开拉取请求。

You can comment though on the Gist and ask the author to update the Gist from your fork.

您可以对 Gist 发表评论,并要求作者从您的 fork 更新 Gist。

回答by studgeek

As @Kevin said, unfortunately GitHub doesn't expose a GUI for pull requests on gists. You can however fork the gist, make your changes in the fork, then share a link to your fork with the original author.

正如@Kevin 所说,不幸的是,GitHub 没有公开用于对要点进行拉取请求的 GUI。但是,您可以分叉要点,在分叉中进行更改,然后与原作者共享指向您的分叉的链接。

If the original author is keeping a local cloned repository of their gist (see How do you manage your gists on github?) then they can do a pull against your fork as a remote using the gist # (e.g. git://gist.github.com/1131276).

如果原作者保留了他们 gist 的本地克隆存储库(请参阅如何在 github 上管理您的 gist ),那么他们可以使用 gist #(例如git://gist.github.com/1131276)对您的 fork 作为远程进行拉取。

回答by Bruno Bronosky

I don't think it is appropriate to have pull request on gists. The intent of gist.github.com was to improve upon the pastebinconcept commonly used in IRC and forums. They chose to call the service "gist" because as vocabulary.com describes it...

我认为对要点提出拉取请求是不合适的。gist.github.com 的目的是改进IRC 和论坛中常用的pastebin概念。他们选择将该服务称为“要点”,因为正如词汇表.com 所描述的那样......

When you need a quick summary of the essentials, rather than the whole story or a thorough explanation, you're looking for the gist.

当您需要对要点进行快速总结而不是整个故事或详尽的解释时,您正在寻找gist

However I will concede that github is missing a very important feature. The ability to create a full github repo out of a gist and keep metadata about its origins.

但是我承认 github 缺少一个非常重要的功能。能够根据要点创建完整的 github 存储库并保留有关其来源的元数据

That would solve most of what people need. At that point, the only form of "request" that someone would need to submit is "hey, won't you make a full repo out of this." And that can be done in the comments. By NOTallowing pull requests, issues, etc. on gists, it allows the author to reply to such a comment with, "nah, it was just a hack I threw together and don't intend to support."

这将解决大多数人的需求。在这一点上,某人需要提交的唯一“请求”形式是“嘿,你不会用这个做一个完整的回购。” 这可以在评论中完成。通过使pull requestsissues等上学家,它允许笔者用,回复这么评论“不,这只是一个黑客我扔在一起,不打算支持。”

StackOverflow won't let you link to pastebin without including a code block. Done.

回答by Alastair

Pulling Gists isn't possible in the same manner as git pull, one could provide the changes via Gist in the form of a .diff/.patch. This can be done locally in your working directory with diffor via GitHub if it's already forked there:

不能以与 相同的方式拉动 Gists git pull,可以通过 Gist 以.diff/的形式提供更改.patch。这可以在您的工作目录中使用diff或通过 GitHub(如果它已经在那里分叉)在本地完成:

This way, it's differential and a lot easier to view/apply the changes, especially if it affects multiple files.

这样,查看/应用更改是不同的并且更容易,特别是如果它影响多个文件。