[英]Github workflow for single developer
I would like some feedback on my git workflow because this is my first use of it and despite reading various articles and Stack Overflow questions, I'm not sure that my process is correct. 我想对我的git工作流程提供一些反馈,因为这是我第一次使用它,尽管阅读了各种文章和Stack Overflow问题,但我不确定我的流程是否正确。 This is my current workflow (note that I am using the Github for Windows application for all of my git interactions):
这是我当前的工作流程(请注意,我正在使用Github for Windows应用程序进行所有git交互):
I am quite happy with the process up until step 7 at which point I am a little confused. 我对这个过程非常满意,直到第7步,我有点困惑。 I think my confusion lies in the fact that I'm trying to use the Github for Windows application rather than using the command line.
我认为我的困惑在于我正在尝试使用Github for Windows应用程序而不是使用命令行。 The application does seem to make things easier but there is a bit of a disconnect in my understanding between some of the commands/instructions I see mentioned and the actions you would take in the application.
该应用程序确实使事情变得更容易,但我对我提到的一些命令/指令与您在应用程序中将采取的操作之间的理解存在一些脱节。
Let me ask some specific questions: 让我问一些具体问题:
git push
at the command line. git push
。 Is that true? Unable to merge
无法合并
Failed to merge 'test' into 'master'.
无法将'test'合并到'master'中。 You might need to open a shell and debug the state of this repo.
您可能需要打开shell并调试此repo的状态。
When this occurred before, I was able to change to the master branch and merge the new branch into the master branch however that no longer works. 当之前发生这种情况时,我能够更改为主分支并将新分支合并到主分支中,但不再有效。 No matter which branch I am in, I cannot merge the two branches.
无论我在哪个分支,我都无法合并这两个分支。 Both are in sync and I've published all the changes from my test branch.
两者都是同步的,我已经发布了测试分支的所有更改。 What should I be typing in the shell to find out why I can't merge the branches?
我应该在shell中输入什么来找出为什么我不能合并分支?
For reference, these are the main links that have prompted my process: 作为参考,这些是促使我的过程的主要链接:
What you are describing sounds like a common branching workflow that works very well even for multiple developers on the same code base. 您所描述的内容听起来像是一个常见的分支工作流程,即使对于同一代码库上的多个开发人员也能很好地工作。 It's pretty much completely covered by git flow which is a extension of git command line to automate certain steps.
它完全由git flow覆盖,它是git命令行的扩展,用于自动执行某些步骤。 It's worth checking out.
值得一试。
I'm not a big fan of UI tools for git. 我不是git UI工具的忠实粉丝。 I'm using the command line most of the time.
我大部分时间都在使用命令行。 So I'm not experienced with GitHub for Windows.
所以我对GitHub for Windows没有经验。 But I bet your problems occur because of your merges are no fast-forwards anymore.
但我打赌你的问题会因为你的合并而不再是快进而发生。 This would require a manual merge step that is (afaik) not covered by the tool.
这将需要手动合并步骤(afaik)未被工具覆盖。
There is no strong reason to keep branches around after merging them into your upstream. 在将它们合并到您的上游后,没有充分的理由保持分支。 But one is to track what commits went into a certain feature.
但一个是跟踪提交进入某个功能的内容。 I would suggest to publish the branches if you decide to keep them.
如果您决定保留它们,我建议发布分支机构。 You are not dependent on the code lying around on you local machine.
您不依赖于本地计算机上的代码。 To keep the branches doesn't make your repository much bigger by the way but pollutes the sight.
保持分支不会使你的存储库变得更大,但会污染视线。 Most of the time the commits are present anyway in your upstream branch.
大多数情况下,提交在您的上游分支中都存在。
You will have to publish (push) your master branch after merging in. 合并后,您必须发布(推送)主分支。
To get familiar with the git command line tool I suggest starting with the Introduction to Git and GitHub from the GitHub guys and follow their link references for more details. 为了熟悉git命令行工具,我建议从GitHub的Git和GitHub简介开始,并按照他们的链接参考了解更多细节。
Hope that helps 希望有所帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.