相关疑难解决方法(0)

樱桃挑选Git意味着什么?

最近,我被要求cherry-pick提交.

那么,在git中挑选一个提交意味着什么呢?你怎么做呢?

git cherry-pick git-cherry-pick

2117
推荐指数
11
解决办法
101万
查看次数

cherry-picking commit - 提交快照或补丁?

我有一个与挑选提交和冲突有关的问题.

'Pro Git'一书解释了提交是一种快照,而不是补丁/差异.

但挑选樱桃可能会表现得像补丁一样.


以下示例,简而言之:

  1. 创建3个提交,每次编辑文件的第一行(和单行)

  2. 将分支重置为首次提交

  3. test1:尝试樱桃挑选第三次提交(冲突)

  4. 测试2:尝试樱桃挑选第二次提交(OK)


mkdir gitlearn
cd gitlearn

touch file
git init
Initialized empty Git repository in /root/gitlearn/.git/

git add file

#fill file by single 'A'
echo A > file && cat file
A

git commit file -m A
[master (root-commit) 9d5dd4d] A
 1 file changed, 1 insertion(+)
 create mode 100644 file

#fill file by single 'B'
echo B > file && cat file
B

git commit file -m B
[master 28ad28f] B …
Run Code Online (Sandbox Code Playgroud)

git cherry-pick

2
推荐指数
1
解决办法
344
查看次数

标签 统计

cherry-pick ×2

git ×2

git-cherry-pick ×1