如何合并GitHub上的要点? [英] How to merge a gist on GitHub?
问题描述
我对GitHub有一个要点,那就是有人分叉并做出改变。我喜欢他们的变化。
有没有办法将变化合并到我原来的要点?
一个要点像任何其他存储库一样运作。假设你已经克隆了一些像git://gist.github.com/2322786.git:
$ $ p $ g $ clone $ git clone git@gist.github.com:2322786.git
(如果您只是想在不推动,您可以使用 git://gist.github.com/2322786.git
,它将演示合并原则并匿名工作,但不允许您推送。)
现在你想合并git://gist.github.com/2661995.git的变化。将它添加为一个额外的遥控器:
$ git remote add changes git://gist.github.com/2661995.git
$ git fetch changes
然后在这样的变化中合并:
$ git merge changes / master
你应该全都设定好。这应该工作,无论新的要点是从你的以前的点分叉还是完全不相关。
考虑到罗曼的评论,你会发出一个 push
:
$ git push
这只有在您的原始克隆网址允许编写时才有效。
I have a gist on GitHub that someone forked and made changes to. I like their changes.
Is there a way to merge the changes back into my original gist?
解决方案A gist operates like any other repository. So let's say you've cloned something like git://gist.github.com/2322786.git:
$ git clone git@gist.github.com:2322786.git
(If you just wanted to try this without pushing, you can use
git://gist.github.com/2322786.git
, which will demonstrate the merge principle and works anonymously, but does not allow you to push.)And now you want to merge in changes from git://gist.github.com/2661995.git. Add it as an additional remote:
$ git remote add changes git://gist.github.com/2661995.git $ git fetch changes
And then merge in the changes like this:
$ git merge changes/master
And you should be all set. This should work regardless of whether the new gist was forked from yours at some previous point or is completely unrelated.
Taking Romain's comment into account, you would then issue a
push
:$ git push
This would only work if your original clone URL allows writing.
这篇关于如何合并GitHub上的要点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!