git - Perforce p4 相当于 git 中的交换

标签 git perforce

我正在寻找p4 interchanges相当于 git 中的内容。是否有任何选项/标志可以查找一个分支中尚未集成/merge 到另一个分支的更改。

我正在寻找此选项来跟踪在我的功能分支中完成的更改是否尚未 merge 到主分支中,然后才能剪切发布分支。

最佳答案

使用 git cherry 怎么样?

git cherry [-v] [<upstream> [<head> [<limit>]]]

  • outputs the SHA1 of every commit between <limit> and <head>,
  • and prefixes a - to commits in the list that have an equivalent in <upstream>
  • and prefixes a + to commits in the list that do not have an equivalent in <upstream>

其中 <upstream><head> 引用 git 分支
<limit> 指的是 git 存储库历史记录中的一次提交。


topic 分支包含三个提交的情况下,
并且维护者将其中两个应用到 origin/master ,情况可能如下所示:

$ git log --graph --oneline --decorate --boundary origin/master...topic
* 7654321 (origin/master) upstream tip commit
|
* cccc111 cherry-pick of C
* aaaa111 cherry-pick of A
|
| * cccc000 (topic) commit C
| * bbbb000 commit B
| * aaaa000 commit A
|/
o 1234567 branch point

现在 git-cherry 将显示尚未应用于 origin/master 的内容的简明摘要:

$ git cherry origin/master topic
- cccc000... commit C
+ bbbb000... commit B
- aaaa000... commit A

在这里,我们看到提交 AC (用 - 标记)已经被挑选到 origin/master 中,而提交 B (用 + 标记) ) 尚未 merge 到 origin/master 中。

When we have 2 local branches X and Y to be compared;

To ask the question:
Are there any commits in branch X that are NOT yet in branch Y?

we would say git cherry branchY branchX and look for any commits listed with a + before them.

引用:man page of git cherry

关于git - Perforce p4 相当于 git 中的交换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35051431/

相关文章:

Git:在所有子模块上递归切换分支( checkout )

c++ - 如何将 git commit-number 包含到 C++ 可执行文件中?

git - 将多个 .gitignore 文件(本地和远程)保存在同一个存储库中

git - SourceTree: pull 列表的远程分支为空

Gitignore 除子文件夹外的所有内容(包含所有内容)?

GIT 和 Perforce : the branching strategy

Perforce - 将本地文件标记为最新版本

java - 通过java追加perforce权限表会导致权限表为空

version-control - 有人可以解释perforce集成选项吗?

perforce - 无法使用集成在 P4 中创建新分支