Git:找到新的樱桃 [英] Git: find new cherries
问题描述
我建立了一个基于亚当斯皮尔斯在前一个SO线程中的回答的流程,定期发布一个Git存储库添加到SVN存储库中的路径。一切工作都很顺利,但还有一件我没有想到。当我抓住随后的Git改变使用摘樱桃
,我怎么找出这对这个混帐侧发生了新的变化,需要将樱桃采摘到SVN为了更具体一些,在我将Git历史记录最初推入SVN之后,我现在坐在一个 master>
/ code>分支,它具有相同的内容&补丁历史记录作为Git的来源,但它与
origin / master
基本上完全不同:
%混帐--no寻呼机DIFF主混帐SVN
%git的状态
#分支主
#你的分支和 '产地/主' 有分歧,
#并且分别有3个和2个不同的提交。
$
没有提交(工作目录干净)
现在,我确实获取新的上游更改:
%git fetch
remote:计数对象:5,完成。
remote:合计3(delta 0),重用0(delta 0)
解包对象:100%(3/3),完成。
从/ cygdrive / c / foo / git / testrep
6d7dd94..08d3d19 master - >起源/大师
在这一点上,我需要弄清楚需要挑选哪些修订,那么我会选择它们并执行 git svn dcommit
。但我无法弄清楚如何得到樱桃的名单。我已经尝试了各种 git cherry
命令,并且都使用 git cherry origin master
和 git cherry主要来源
报告每一边基本上每个变化的长列表。
我是否应该解析最后一个从日志文件中挑选出来的樱桃?我使用 git的樱桃采摘-x
,所以我有一个有记录。
之后> git cherry-pick
... git svn dcommit
round,我做了一个 git tag -f最后挑选的原点
。然后下一次,我可以从最后挑选的
到原点
选择樱桃。 如果他们有更好的解决方案,我愿意将某人的答案标记为已接受,但在这一点上,看起来我并不一定需要其他答案。
I've set up a process, based on Adam Spiers' answer in a previous SO thread, to periodically publish a Git repository to a path in an SVN repository. Everything is working quite well, but there's one piece I haven't figured out. When I'm grabbing subsequent Git changes using cherry-pick
, how do I figure out which new changes have occurred on this Git side, needing to be cherry-picked into the SVN side?
To be more specific, after I do the initial push of the Git history into SVN, I'm now sitting on a master
branch which has the same content & patch history as the Git origin, but it's diverged from origin/master
for basically its full history:
% git --no-pager diff master git-svn
% git status
# On branch master
# Your branch and 'origin/master' have diverged,
# and have 3 and 2 different commit(s) each, respectively.
#
nothing to commit (working directory clean)
Now, I do a fetch of new upstream changes:
% git fetch
remote: Counting objects: 5, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /cygdrive/c/foo/git/testrep
6d7dd94..08d3d19 master -> origin/master
At this point, I need to figure out which revisions need to be cherry-picked, then I'll cherry-pick them and do a git svn dcommit
. But I can't figure out how to get that list of cherries. I've tried various git cherry
commands, and both git cherry origin master
and git cherry master origin
report long lists of basically every change on each side.
Should I resort to parsing the last cherry-pick out of the log file? I'm using git cherry-pick -x
, so I do have a record there.
So I think I have a solution - after every git cherry-pick
... git svn dcommit
round, I do a git tag -f last-picked origin
. Then next time, I can cherry pick from last-picked
to origin
.
I'm willing to mark someone's answer as accepted if they have a better solution, but at this point it looks like I don't necessarily need another answer.
这篇关于Git:找到新的樱桃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!