如何从本地分支(GIT)中的所有提交生成补丁文件?(How can i generate a patch file from all commits in a local branch (GIT)?)

编程入门 行业动态 更新时间:2024-10-27 14:25:53
如何从本地分支(GIT)中的所有提交生成补丁文件?(How can i generate a patch file from all commits in a local branch (GIT)?)

我想生成一个包含来自本地分支的所有提交的补丁。 没有与主人比较。 (因为部分提交已经与主服务器合并。)

I would like to generate a patch with all commits from a local branch. Without Comparing to the master. (because a part of the commits are already merged with the master.)

最满意答案

您可以使用git diff srchash..HEAD > whatever.patch其中srchash是基本提交的SHA-1。 如果当前未检出分支,请使用branchname而不是HEAD

You can use git diff srchash..HEAD > whatever.patch with srchash being the SHA-1 of the base commit. If the branch is not currently checked out, use branchname instead of HEAD

更多推荐

本文发布于:2023-08-04 12:54:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1416138.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:分支   补丁   文件   GIT   generate

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!