how does branching works , using the gitflow workflow?

Viewed 75

I am working on a project and we are using gitflow workflow. Basically I am just new to gitflow workflow , I have just a question.

There were two branches from the repository which is the master and the development branch . I checked out the development remote branch since This branch will contain the complete history of the project.

Now I wanted to get the updates from the team the latest one ,should I pull it from the master branch ? or in the development branch ?

Another thing if i push my changes , should i push my changes on origin/master ? or origin development ?

By the way all of us developers checked out the development branch remotely. using the command git checkout -b development origin/development

Bear with me just new to git workflow. Thank you.

1 Answers

Now I wanted to get the updates from the team the latest one ,should I pull it from the master branch ? or in the development branch?

All of your team mates changes should be in the develop branch.

Another thing if i push my changes , should i push my changes on origin/master ? or origin development?

Your standard work-flow should be to create a feature branch off develop, and then merge this back into develop when your feature is complete. Periodically (many agile teams align this with their sprint cadence) you'll create a release branch off develop and merge this branch into master, thereby releasing all of the code that's in your develop branch.

Finally if you have an urgent issue that you need to fix (e.g. a live bug) then you'll want to create a hotfix branch off master and merge this into master and down into develop.

Returning to your original question: if your team mates all follow this work flow too then you should see that all of your team mates changes should be in the develop branch on your remote.

For more reading about Git Flow: https://nvie.com/posts/a-successful-git-branching-model/

Edit: when you do a release you also need to merge your release branch back down into develop.

Related