[英]How can I add git to my workflow without introducing extensive overhead?
Currently my web development workflow for live sites is pretty broken and I am looking to improve the process. 目前,我的实时网站开发工作流程已经中断,我正在寻求改进流程。 I have no version control and am more often than not doing direct edits over FTP to the live site. 我没有版本控制,通常比不通过FTP直接编辑实时站点更多。 Because of that, this is a new workflow I am thinking of implementing and would love your feedback. 因此,这是我正在考虑实施的新工作流程,希望您能提供反馈。 Along the same lines, feel free to let me know "that workflow is stupid... you should do X instead". 同样,随时让我知道“工作流程很愚蠢……您应该改用X”。
Goals/hopes/dreams: 目标/希望/梦想:
Proposed Workflow: 拟议的工作流程:
I know this isn't the most ideal workflow as I technically don't have a true staging environment, etc but seeing as I am just a one person dev team I feel like this may be sufficient. 我知道这不是最理想的工作流程,因为从技术上讲我没有真正的暂存环境等,但是看到我只是一个人的开发团队,我觉得这可能就足够了。 Also, since I'm coming from live FTP edits to the site, I know that if I introduce too much overhead I'll end up just editing the site again after a short period and I want to make sure I stick with this new method. 另外,由于我来自现场FTP编辑,所以我知道如果引入过多的开销,我将在短时间后再次编辑该站点,我想确保自己坚持使用这种新方法。
Anywho, anyone have any thoughts or suggestions on this approach? 谁对此方法有任何想法或建议? Would love to hear the feedback of the more seasoned devs here. 很想听听这里经验丰富的开发人员的反馈。
Above everything else, I'd like to stress one thing. 最重要的是,我想强调一件事。 If you take nothing else from this answer, please think about this. 如果您没有其他答案,请考虑一下。 Regardless of your workflow, you should always use some form of version control. 无论您的工作流程如何,都应始终使用某种形式的版本控制。 Using version control has many benefits, not the least of which is providing you some piece of mind that your code is safe, but it will also allow you to develop code faster. 使用版本控制有很多好处,其中最重要的一点是使您确信代码是安全的,但同时也可以使您更快地开发代码。 I don't have the book in front of me, so I can't provide an exact reference, but Steve McConnell's book "Rapid Development: Taming Wild Software Schedules" hits on the topic again and again if you need some convincing that version control will actually save you time instead of "introducing extensive overhead." 我没有这本书,因此无法提供确切的参考,但是如果您需要一些令人信服的版本控制,史蒂夫·麦康奈尔(Steve McConnell)的书“快速开发:驯服野性软件计划”将一再提及该主题。实际上将节省您的时间,而不是“引入大量开销”。
Why did I start out an answer to a question about a workflow like this? 为什么我要开始回答有关这样的工作流程的问题? Regardless of what else you change in your workflow, you can begin integrating git immeadiatly with very little overhead. 不管还有什么,你在你的工作流程改变,你就可以开始用很少的开销immeadiatly整合饭桶。 Adding git to your site is as simple as navigating to your working directory and typing git init
. 将git添加到您的站点就像导航到工作目录并键入git init
一样简单。 That's it, you now have a git repository that you can check code into. 就是这样,您现在有了一个git存储库,可以将代码检入其中。
I won't pretend that there isn't a little bit of a learning curve to git. 我不会假装git没有一点学习曲线。 One of the programs biggest drawbacks in my opinion is that it isn't very user-friendly to those unfamiliar with it. 我认为该程序的最大缺点之一是,它对那些不熟悉它的用户不是很友好。 Don't let that daunt you though, once you sort of grok git, all of the commands make sense and actually accomplishing stuff will be pretty straight forward. 但是,不要让那让您望而却步,一旦您了解了git git,所有的命令就有意义了,并且实际上完成工作将非常简单。 For help with finding that "AH-HA!" 为了帮助您找到“ AH-HA!” moment, please see think-like-a-git or the excellent git internals book. 此刻,请参阅git-like或优秀的git内部手册。
Now on to the good part, Improving your workflow. 现在好了,改善您的工作流程。 Generally, I like the workflow you've suggested, and I bet it will be a big improvement over what you are doing now. 通常,我喜欢您建议的工作流程,并且我敢打赌,它将比您现在正在做的工作有很大的改进。 I don't think you should do anything radically different from what you suggested. 我认为您不应做与建议完全不同的任何事情。 Instead, lets turn it up to 11 ! 取而代之的是将其设置为11 !
Here are my suggestions: 这是我的建议:
git checkout
. 通过从开发计算机“拉”到活动服务器,您可以更精确地控制在其中部署了什么代码,并且回滚错误就像进行新的git checkout
一样容易。 As a final note, I'd recommend that you checkout Atlassian's Source Tree git software. 最后,我建议您检出Atlassian的Source Tree git软件。 In my opinion, this is the best windows git client out there. 我认为,这是最好的Windows git客户端。 It even provides tools for doing git-flow! 它甚至提供了执行git-flow的工具!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.