简体   繁体   English

Git svn提交id

[英]Git svn commit with id

I am working to setup a local git that bases it's repository on a SVN store. 我正在设置一个本地git,它将它的存储库建立在SVN存储上。

All looks ok but how do I link a work item id with a comment to svn store when I run "git svn dcommit"? 一切看起来还不错,但是当我运行“git svn dcommit”时,如何将工作项ID与注释链接到svn商店?

You can also run git svn dcommit -e and add the tags interactively to each commit during the dcommit process. 您还可以运行git svn dcommit -e并在dcommit过程中以交互方式将标记添加到每个提交。 Our svn hooks require the bug ID in the first line of the commit message, and since that messes with git log --oneline output, I like to wait until I dcommit to add it. 我们的svn钩子需要提交消息的第一行中的错误ID,并且由于这与git log --oneline输出git log --oneline ,我想等到我dcommit添加它。

For every svn commit git svn dcommit takes the commit message from the corresponding git commit. 对于每个svn commit, git svn dcommit从相应的git commit获取提交消息。 So you write your ticket id in the commit message like you did in subversion before you transfer it into svn. 因此,您在提交消息中编写了您的票证ID,就像您在转换为svn之前在subversion中所做的那样。

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. 当你已经提交没有这些ID的提交时,你可以使用git rebase -i HEAD~10编辑提交的消息, 然后再将其推送到svn。

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. 我只需要格式化git commit消息,以便post commit hook能够读取提交并在任何地方发送它。 We are using mantgis and buildmaster user Issue : : XXXXX format where XXXXX is a number. 我们正在使用mantgis和buildmaster用户问题:: XXXXX格式,其中XXXXX是一个数字。 So your commit message simply looks like "my commit message Issue : : XXXXX". 因此,您的提交消息看起来像“我的提交消息问题:: XXXXX”。 You can even add "Reviewed By : : K. Colleague" before "Issue" token. 您甚至可以在“发行”令牌之前添加“已审核::K。同事”。 Remember to check your buildmaster what format he uses for the hooks. 请记住检查您的buildmaster他用于钩子的格式。 It varies... 它有所不同......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM