Search code examples
githubgit-stash

Git workflow for multiple feature branch


Our current stash repository has a Master and Develop branch. Anytime if a developer is working on a story a developer creates a branch and once the coding is done a pull request is raised to merge to develop.

So far it has been good but when two developers are working on different feature branches on a same Repository if a developer merges his changes to develop and other one is still working on, there are issues like merge conflicts and we don't want the two different feature branches to be released together.

I know this is not an issue but we want to avoid release multiple feature branches at a time.

Any thoughts on this on what are the best practices.


Solution

  • I would suggest to create tags after you have merge to "develop" branch. There is no harm if you wish to release code from "master" branch using tags as well. Honestly speaking there aren't any hard lines drawn on how you wish to release your code from Git hosted repos?

    You may like to follow this sequence

    rebase the feature brnach of second dev from develop branch to get changes of dev1 and avoid merge conflicts

    git checkout feature_branch2
    git rebase develop

    merge feature-branch2 to develop branch

    git checkout develop
    git merge feature_branch2

    tag the version you wish to release

    git checkout provide_version_you_wish_to_release
    git tag tag_name