Question

I've been working on a number of different project files, some new and some old. Is there a usual/normal/acceptable method of staging a checkin so that other developers can take a look and QA the code?

I don't want to fully commit/checkin the code as some of it is half baked, but would like some other developers to take a look...

Was it helpful?

Solution

You can commit to a different branch, and then merge into master when the code has been tested by others.

Your workflow:

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'

Their workflow:

git pull origin
git checkout origin/my_new_feature

After the code is tested

git checkout master
git merge my_new_feature

OTHER TIPS

You can commit your code to a feature branch, and publish the branch. This allows all the other devs to pull a copy and switch to it for local review, without affecting their own code. Git Flow is a good example of this:

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top