gpt4 book ai didi

Git:我不明白 pull 请求怎么可能像这样工作

转载 作者:太空狗 更新时间:2023-10-29 14:45:46 26 4
gpt4 key购买 nike

我想了解如何从命令行执行 Git Pull Requests。我在这里找到了关于此的文档:http://git-scm.com/docs/git-request-pull - 查看示例部分)。如果我想应用这个概念,我想我必须像这样进行我们的流程:

# Never work directly on 'master', unless we have trivial changes.
# Create privat branch instead.
git checkout -b mybranch
# hack hack hack
git add .
git commit -m ...
git checkout master
# For the safe side (in case someone else has pushed meanwhile):
git pull
# Record the SHA from this
last_commit=$(git rev-parse --short HEAD)
git merge mybranch
# Now following the Example at http://git-scm.com/docs/git-request-pull
git push # <------------------- Here be dragons!!!!
git pull-request $last_commit https://my.repository.url/blabla master

在这个例子中,我发现 push 的位置很奇怪。据我了解, pull 请求的全部 Gist 是,只有那些更改会进入 master,这些更改是“已批准”的(即不要自动进入 origin/master)。但是,当我进行推送时,它们会立即在最新版本的 master 中可见。

也许有人可以在这里启发我?

最佳答案

http://git-scm.com/docs/git-request-pull第一个 push 是从您的本地计算机(例如,您的笔记本电脑)推送到您在分享网站。共享站点版本允许其他人阅读它,但首先您必须将它写在那里,并执行 push 步骤。

一旦 push 到您的“可见”、共享站点、存储库完成,您可以向(管理人员)发送 pull 请求到第三个存储库,然后他们可以获得从您的可见存储库提交。您笔记本电脑上的“工作”存储库对外界是不可见的,因此如果您只将它们保存在笔记本电脑上,他们将无法获得您的提交。

关于Git:我不明白 pull 请求怎么可能像这样工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28166328/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com