如何使用git修改开源项目并让其他人更新项目而不丢失我的更改
因此,我想对 status.net(开源 Twitter 克隆)进行一些更改。
假设我想让人们可以在他们的“推文”中添加字体。
但是,我想继续从 status.net 人员那里获取更新...假设他们进行了一些更改并修复了一些安全漏洞或添加了新的辅助功能。
所以,我会想要
git clone <url to status.net repo>
然后,什么? :)
我如何进行更改,将它们正确存储在 git 中,并与来自“网络”的新更改正确合并(?)?
与“(在此处进行更改)”交织在一起的一系列命令将对我有很大帮助。
谢谢!
So, I'd like to make some changes to status.net (an open source Twitter clone).
Let's say I want to make it so that people can add fonts in their 'tweets', hypothetically.
But, I want to keep getting updates from the status.net people...Let's say they make some changes and fix some security holes or add a new auxiliary feature.
So, I'll want to
git clone <url to status.net repo>
Then, what? :)
How do I make my changes, store them in git properly, and merge(?) properly with new changes coming from the 'net?
A sequence of commands, interwoven with "(make your changes here)" would help me a lot.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要做出改变,你首先要戴上程序员的帽子,做你一直做的事情。我真的无法帮助您:-)
接下来,您需要提交更改。要提交,只需说:
并在提示符处键入描述性消息。请注意,git 中的“提交”不会公开您的更改。它只是提交到您的存储库的本地副本;直到你将来
git Push
之前,没有人会看到它。要将其他人对您的存储库副本所做的更改合并:
如果您可以直接访问存储库,则可以将您之前所做的 git commit 向公众公开:
否则,您可以将您提交的补丁并将其发送给友好的维护人员:
最后,如果您想向存储库添加新文件,请说:
要删除文件,您只需像平常一样删除它们即可(使用 rm > shell 命令),然后 git commit -a 进行更改。
To make changes, you first put on your programmer hat and do what you always do. I really can't help you there :-)
Next, you'll want to commit your changes. To commit, just say:
and type a descriptive message at the prompt. Note that "commit" in git does not make your changes public. It merely commits to your local copy of the repository; nobody sees it until you
git push
in the future.To merge changes other people made into your copy of the repository:
If you have direct access to the repository, you can make the
git commit
s you did earlier available to the public with:Otherwise, you can convert your commits into patches and send them to your friendly maintainer:
Lastly, if you want to add new files to the repository, say:
To remove files, you can simply remove them like you normally would (with the
rm
shell command), thengit commit -a
the change.以下链接似乎处理了所有细节:
http://status.net/wiki/IntroToUsingGit
目前尚不清楚您是否需要其他查看您的存储库,以及您是否希望最终将更改推送回 status.net 主 git 存储库,以便集成商将您的更改合并到主干中。
The following link seems to deal with all the details:
http://status.net/wiki/IntroToUsingGit
It is not clear at this point if you want others to see your repository and if you want to eventually push you changes back to status.net main git repository in order for an integrator to merge your changes in the main trunk.
除非您是值得信赖的开发人员,否则您可能无法将更改推送回来。在这种情况下,您将向他们发送“拉取请求”。本文告诉您如何做到这一点: http://www.kernel.org/pub/software/scm/git/docs/git-request-pull.html
You might not be able to push your changes back up unless you are a trusted developer. In that case you'll seed to send them a "pull request". This article tells you how to do just that: http://www.kernel.org/pub/software/scm/git/docs/git-request-pull.html