新 Git 用户:建议的工作流程帮助(具体示例)
我已经阅读了大部分 Progit Book 和 本教程 以及。我想我对 git 的力量、它的低成本分支等有了很好的了解。但是,我有一个非常具体的示例需要帮助,我认为这将更好地帮助我理解如何将 Git 引入我的工作流程。
我有一份文件,里面有一篇文章。这篇文章是为奖学金申请 1 提交的。我为该提交创建了一个名为“scholarship1”的标签,这样当我的主分支发生更改时,我始终可以轻松引用我为该奖学金转换的版本。我现在有另一项奖学金(奖学金2)的新申请。它非常相似,但格式有些不同,所以我必须更改文章的内容以匹配格式。
我正在考虑创建一个新分支(称为奖学金2版本)并在那里工作/编辑。然后,当该版本完成后,将其合并回master(我认为在我的情况下这只是快进合并,因为我没有积极推进master分支)并将其标记为scholarship2。然后我就可以继续这个模式。这样,如果我在处理奖学金2申请奖学金1时,有人打电话给我并说“我们需要您使用不同的字体重新提交等”,我可以切换回master进行更改并重新提交。
我只是想与大家核实一下(这就是我将其设为社区 wiki 的原因),看看是否有针对这种情况的更好的建议工作流程。
I have read most of the Progit Book and this tutorial as well. I think I am getting a very good idea of gits power, its low-cost branching, etc. However, I have a very specific example that I need help with that I think will better help me understand how to bring Git into my workflow.
I have a document with an essay in it. This essay is submitted for scholarship application 1. I created a tag for that commit called "scholarship1" so that when my master branch changes I can always easily reference the version I turned it for that scholarship. I now have a new application for another scholarship (scholarship2). It is very similar but in some what of a different format, so I would have to change around the contents of the essay to match the format.
I am considering making a new branch (called something like scholarship2-version) and working/editing there. Then, when that version is done, merging it back into the master (which I think in my case would just be fast forward merge since Im not actively advancing the master branch) and tagging it as scholarship2. Then I can continue this pattern. That way, if lets say while Im working on scholarship2 application scholarship1 people call me and say "we need you to resubmit with a different font, etc" I can just switch back to master make the changes and resubmit.
I just want to check with you all (thats why I made it a community wiki) to see if there is a better suggested workflow for this situation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您有两种选择,要么为论文的每个不同版本创建一个新分支,要么在您的工作分支中复制论文副本。
如果您认为您想要在多个版本之间共享更改,那么请选择多分支路线。如果每个版本在“分支”后都将独立,那么最好将论文复制到新文件中。当然,您仍然可以走多分支路线,但除了分离文档每个版本之间的提交之外,我不确定您会获得什么。
You have two options, either create a new branch for each different version of the essay, or make a duplicate copy of the essay in your working branch.
If you think you are going to want to share changes between multiple versions, then go to the multi-branch route. If each version is going to stand alone after you "branch", then might be better just to copy the essay to a new file. Of course you can still go the multi-branch route, but I'm not sure what you will gain, other than separating the commits between each version of the doc.