我的团队正在使用Bitbucket作为我们的git存储库,我们最近开始使用pull请求功能进行代码审查 . 它在第一次审核时工作正常,但是如果它经历了多次迭代(即,进行了更改并且更新了拉取请求),我希望看到仅包含自上次代码审查以来所做的新更改的链接 .
我查看了“比较”功能,但UI看起来只能在分支之间进行比较 . 是否有一种简单的方法可以在两次提交之间获得差异?
这只是对已经给出的答案的略微修改,但是添加#diff而不是#commits通常是我正在寻找的 . 另外,正如其他人可能已经提到的那样,对我来说最好的结果通常是通过将较新的提交放在第一个和较旧的一秒来获得,但这取决于您的特定需求 .
https://bitbucket.org/<OWNER>/<REPO>/branches/compare/<commit-hash>..<commit-hash-older>#diff
尝试类似的东西:
https://bitbucket.org/<OWNER>/<PROJECT>/branches/compare/<commit1>..<commit2>#commits
摘自:https://bitbucket.org/site/master/issue/4779/ability-to-diff-between-any-two-commits
Bitbucket现在支持比较标签 .
https://bitbucket.org/<OWNER>/<PROJECT>/branches/compare/<tag1>%0D<tag2>
bitbucket.org上的Compare页面上的分支/标记下拉列表中的搜索字段现在支持粘贴的提交哈希 .
所以现在你可以转到 https://bitbucket.org/<owner>/<repo>/branches/compare/ 并将哈希值粘贴到下拉列表而不是URL黑客攻击!
https://bitbucket.org/<owner>/<repo>/branches/compare/
我有Bitbucket Server,版本:v4.4.1
我的答案就是这个 .
http://<path-to-my-server>/projects/<project-name>/repos/<repo-name>/commits/<old>?to=<new>
我正在寻找这个答案,因为在我的项目中我们使用git子模块,并且在pull请求中我只能看到旧的commit sha与每个更改的子模块的新commit sha . 没有链接点击或任何(我知道)跳转到这个差异视图 . 此URL允许我查看子模块中的更改 .
顺便说一句,如果有人知道在拉取请求期间比较子模块中两个提交的更好方法,请告诉我 .
Bitbucket比较视图格式如下:
https://bitbucket.org/<owner>/<repo>/branches/compare/<new>%0D<old>
给出一个示例 ged/ruby-pg (RubyGem,一个ruby库):
ged/ruby-pg
To compare two releases (from v0.18.1 to v0.18.2)
https://bitbucket.org/ged/ruby-pg/branches/compare/v0.18.2%0Dv0.18.1
To compare two revisions (from f97dd6c to 22a3612)
https://bitbucket.org/ged/ruby-pg/branches/compare/22a361201fd1d387d59a066b179124694a446f38%0Df97dd6cb4f34da6a62c4339887249115c7c25b9c
对我有用的是https://bitbucket.org/-theusername-/-projectnamealllowercase-/branches/compare/-Leftalphanumberic_commitcode-..-Rightalphanumeric_commit-#commits
将 -username- 替换为 username
-username-
username
感谢@Aguardientico
为要比较的提交创建一个light标签 . git -a [tagname] [commit_sha]
然后在Bitbucket中,在比较菜单(要执行拉取请求的那个)中,只需与标签进行比较 .
通过终端,在项目路径上运行git:
git diff <new commit> <old commit>
例如: git diff 26cf60f be5f978
git diff 26cf60f be5f978
9 回答
这只是对已经给出的答案的略微修改,但是添加#diff而不是#commits通常是我正在寻找的 . 另外,正如其他人可能已经提到的那样,对我来说最好的结果通常是通过将较新的提交放在第一个和较旧的一秒来获得,但这取决于您的特定需求 .
尝试类似的东西:
https://bitbucket.org/<OWNER>/<PROJECT>/branches/compare/<commit1>..<commit2>#commits
摘自:https://bitbucket.org/site/master/issue/4779/ability-to-diff-between-any-two-commits
Bitbucket现在支持比较标签 .
bitbucket.org上的Compare页面上的分支/标记下拉列表中的搜索字段现在支持粘贴的提交哈希 .
所以现在你可以转到
https://bitbucket.org/<owner>/<repo>/branches/compare/
并将哈希值粘贴到下拉列表而不是URL黑客攻击!我有Bitbucket Server,版本:v4.4.1
我的答案就是这个 .
我正在寻找这个答案,因为在我的项目中我们使用git子模块,并且在pull请求中我只能看到旧的commit sha与每个更改的子模块的新commit sha . 没有链接点击或任何(我知道)跳转到这个差异视图 . 此URL允许我查看子模块中的更改 .
顺便说一句,如果有人知道在拉取请求期间比较子模块中两个提交的更好方法,请告诉我 .
Bitbucket比较视图格式如下:
给出一个示例
ged/ruby-pg
(RubyGem,一个ruby库):To compare two releases (from v0.18.1 to v0.18.2)
https://bitbucket.org/ged/ruby-pg/branches/compare/v0.18.2%0Dv0.18.1
To compare two revisions (from f97dd6c to 22a3612)
https://bitbucket.org/ged/ruby-pg/branches/compare/22a361201fd1d387d59a066b179124694a446f38%0Df97dd6cb4f34da6a62c4339887249115c7c25b9c
对我有用的是https://bitbucket.org/-theusername-/-projectnamealllowercase-/branches/compare/-Leftalphanumberic_commitcode-..-Rightalphanumeric_commit-#commits
将
-username-
替换为username
感谢@Aguardientico
为要比较的提交创建一个light标签 . git -a [tagname] [commit_sha]
然后在Bitbucket中,在比较菜单(要执行拉取请求的那个)中,只需与标签进行比较 .
通过终端,在项目路径上运行git:
git diff <new commit> <old commit>
例如:
git diff 26cf60f be5f978