了解 Git 工作流程
请耐心等待,因为我仍在尝试使用 git 找到解决办法。 到处进行分叉和分支的整个实践使得理解正在发生的事情变得有点困难。
我正在尝试让工作流程继续进行,但是我遇到了障碍。到目前为止,这就是我所拥有的:
1. 分叉项目
2. 在本地克隆分叉
$ git clone [email protected]:MyName/foo.git
3. 添加上游远程,以便您的分叉可以保持最新
$ git remote add upstream [email protected]:OriginalName/foo.git
4 在克隆中的分支上工作:
$ git checkout -t origin/branchName
5 从原始(上游)项目的分支更新:
$ git fetch upstream
$ git merge upstream/branchName
6 提交并推送我的叉子中的更改
$ git commit -a -m "some message"
$ git push
如何获取我的叉子中的更改fork 到原来的项目?有人告诉我拉取请求,但是我找不到运行的命令来实现这一点。谷歌并没有提供帮助。
我应该从上游检查分支,合并我的分支,然后推送吗?
我应该将原始项目克隆到不同的目录中,将分支添加为上游,合并并推送吗?
Please have some patience as I am still trying to find my way around with git.
The whole practice of forking and branching all over the place makes it a bit harder to grok what's going on.
I am trying to get a workflow going but, I'm running into hurdles. So far, this is what I have:
1. Fork project
2. Clone the fork locally
$ git clone [email protected]:MyName/foo.git
3. Add the upstream remote so your fork can be kept up to date
$ git remote add upstream [email protected]:OriginalName/foo.git
4 Working on a branch in the clone:
$ git checkout -t origin/branchName
5 Update from the orginal (upstream) project's branch:
$ git fetch upstream
$ git merge upstream/branchName
6 Commit and push changes in my fork
$ git commit -a -m "some message"
$ git push
How do I get the changes in my fork to the original project? I'm told pull requests but, I can't find the command to run to make that happen. Google hasn't been to helpful.
Should I checkout the branch from upstream, merge my fork, and push?
Should I clone the original project in a different directory, add the fork as an upstream, merge, and push?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
拉取请求是在项目的 Github 页面中完成的。
希望这有帮助。
The pull request is done in the Github page of your project.
Hope this helps.
“拉取请求”是 GitHub 功能,而不是 git 功能。
"Pull request" is a GitHub function, not a git function.
您所询问的称为集成商工作流程,也称为集成管理器工作流程。许多开发人员首先发现这令人困惑,尤其是在长期使用集中式版本控制系统之后。
好消息:它相当简单,但是您需要了解“blessed repository”、“forking”、“commit”、“push”和“pull”的含义以及如何正确设置访问权限关于所使用的不同报告。
Intland 为我们的团队制作了一个教程:什么是集成器工作流程?如果您有6分钟,值得一看。
What you are asking about is called the integrator workflow, also known as the integration manager workflow. Many developers find this confusing first, especially after working with centralised version control systems for a long time.
Good news: it is fairly simple, but you need to understand what "blessed repository", "forking", "commit", "push" and "pull" mean and how to correctly setup the access rights on the different reports used.
We at Intland made a tutorial for our team: What is the Integrator Workflow? If you have 6 minutes, it is worth a watch.