使用 id 进行 Git svn 提交
我正在努力设置一个本地 git,其存储库基于 SVN 存储。
一切看起来都不错,但是当我运行“git svn dcommit”时,如何将工作项 id 与注释链接到 svn 存储?
I am working to setup a local git that bases it's repository on a SVN store.
All looks ok but how do I link a work item id with a comment to svn store when I run "git svn dcommit"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于每个 svn 提交,
git svn dcommit
从相应的 git 提交中获取提交消息。因此,您在提交消息中写入您的票证 ID,就像在 Subversion 中所做的那样,然后再将其传输到 svn。当您已经在没有这些 ID 的情况下进行提交时,您可以在将提交推送到 svn 之前使用 git rebase -i HEAD~10 编辑提交消息。
For every svn commit
git svn dcommit
takes the commit message from the corresponding git commit. So you write your ticket id in the commit message like you did in subversion before you transfer it into svn.When you already made your commits without these IDs, you can use
git rebase -i HEAD~10
to edit the message of a commit, before you push it into svn.您还可以运行 git svn dcommit -e 并在 dcommit 过程中以交互方式将标签添加到每个提交。我们的 svn 钩子需要提交消息第一行中的错误 ID,并且由于这与 git log --oneline 输出混淆,我喜欢等到我提交后再添加它。
You can also run
git svn dcommit -e
and add the tags interactively to each commit during the dcommit process. Our svn hooks require the bug ID in the first line of the commit message, and since that messes withgit log --oneline
output, I like to wait until I dcommit to add it.花了一段时间才想起我问过这个问题。解决方案非常简单。我只需格式化 git 提交消息,以便提交后挂钩能够读取提交并将其分派到任何地方。我们使用的是mantgis和buildmaster用户的问题:XXXXX格式,其中XXXXX是数字。所以你的提交消息看起来就像“我的提交消息 Issue : : XXXXX”。您甚至可以在“Issue”标记之前添加“Reviewed By : : K. Colleague”。请记住检查您的建造师他使用的挂钩格式。它各不相同...
Took a while to remember I asked this question. The solution was pretty simple. I just has to format the git commit message so the post commit hook was able to read the commit and dispatch it wherever. We are using mantgis and buildmaster user Issue : : XXXXX format where XXXXX is a number. So your commit message simply looks like "my commit message Issue : : XXXXX". You can even add "Reviewed By : : K. Colleague" before "Issue" token. Remember to check your buildmaster what format he uses for the hooks. It varies...