你如何制作一个补丁来显示第一次提交之前的分支和同一分支中最后提交的版本之间的区别? [英] How do you make a patch showing the difference between the branch before the first commit and the last committed version in the same branch?

查看:124
本文介绍了你如何制作一个补丁来显示第一次提交之前的分支和同一分支中最后提交的版本之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个叫做ticket20的分支,并且我做了10次提交,我想做一个补丁,显示当我第一次创建它(0提交)和现在(第10提交)时ticket20之间的差异。我知道你可以用git diff做一个补丁,但是我不知道如何定位第0次提交和第10次提交。 解决方案

如果您分支 master

  git diff master。 ..ticket20 

如果您使用分支远程或以其他方式跟踪您的分支点, git branch -t git config branch.autosetupmerge true

  git diff ticket20 @ {u} ... ticket20 

如果您已经把它签出,

  git diff @ {u} ... 

三点语法特定于差异,它表示自合并基础。


I have a branch called ticket20 and I made 10 commits, I want to make a patch that shows the diff between ticket20 when I first created it (0 commit) and now (10th commit). I know you can make a patch with git diff, but I don't know how to target the 0th commit and the 10th commit.

解决方案

If you branched off master,

git diff master...ticket20

If you branched off a remote or otherwise tracked your branchpoint with git branch -t or git config branch.autosetupmerge true,

git diff ticket20@{u}...ticket20

If you've got it checked out,

git diff @{u}...

The three-dot syntax is specific to diff, it means "since the merge base".

这篇关于你如何制作一个补丁来显示第一次提交之前的分支和同一分支中最后提交的版本之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆