允许其他开发人员在推入主干之前对我的代码进行质量检查?

时间:2011-08-17 14:07:52

标签: git version-control git-extensions

我一直在研究许多不同的项目文件,一些新的和一些旧的。是否有通常/正常/可接受的登记方式,以便其他开发人员可以查看和QA代码?

我不想完全提交/签入代码,因为其中一些已经完成了一半,但是希望其他一些开发人员看看...

2 个答案:

答案 0 :(得分:1)

您可以提交到其他分支,然后在代码经过其他人测试后合并到master

您的工作流程:

git checkout -b my_new_feature # create a new branch 'my_new_feature' and switch to it
git add . # add all files to staging area
git commit -m "Add my new feature" # commit the change
git push origin my_new_feature # push this branch to 'origin'

他们的工作流程:

git pull origin
git checkout origin/my_new_feature

代码测试后

git checkout master
git merge my_new_feature

答案 1 :(得分:0)

您可以将代码提交到功能分支,然后发布分支。这允许所有其他开发人员提取副本并切换到它以供本地审阅,而不会影响他们自己的代码。 Git Flow就是一个很好的例子:

http://nvie.com/posts/a-successful-git-branching-model/

相关问题