git - git diff between head of branch and tail of branch
问题描述
I'm about to take over work on a git branch that was started by someone else on my team. He had to make quite a few changes, and I'm also going to have to make quite a few changes. This will all be happening while other devs are merging smaller changes to the target branch.
Before I start making my changes on this branch, I want to record in a diff file all the changes that were made in this branch. That is like HEAD vs. TAIL, but I don't know how to do that.
I've seen ways to compare head against the "first" commit, but that's not quite what I need. I believe also that comparing HEAD against the target branch wouldn't be right, because that would be HEAD of that branch, not the commit my branch was branched from.
解决方案
这是从https://stackoverflow.com/a/28193089/2793683获取的,但是您可以简单地在要比较的两个更改集上放置一个标签,然后使用以下内容:
git diff tag1..tag2 > mypatch.patch
推荐阅读
- c - 针对固定文本和大量子字符串的最快字符串搜索算法
- c# - 如何使用模态窗口将 WM_INPUTLANGCHANGEREQUEST 发送到应用程序?
- c++ - void*、扩展和模板。利与弊
- c# - 使用计时器逐行读取文本文件
- angular - Angular 6 ng serve 完全运行,但 ng build 抛出错误
- android - React-Native:导航到堆栈导航器中的抽屉
- html - 如何使用 Jekyll 通过自定义 YAML 前端变量对帖子进行排序?
- ruby-on-rails - Bundler 无法找到似乎在要求范围内的多个 gem 的兼容版本
- android - 颤动中 TabView 的动态子项
- ios - 当我们从 iOS url 方案打开 gmail 应用程序时,邮件正文上的空格