Initially this was working fine until an additional requirement was added that only merges via Pull Requests were to be allowed for getting work on the Develop branch. Because of the permission change you could no longer Finish Your feature and push your merged changes from your local develop branch up to the origin. You would get a nice permission denied message. I search high and low and could not find anything out there with a solution.
This is the process I came up with to manage feature work. I will have some additional posts on managing work for Releases and Hotfix branches.
- Start feature branch from your JIRA ticket.
- Leave as a Feature branch type
- Name of branch must be JIRA ticket (CHI-7)
- This is equivalent to GitFlow Start Feature
- Checkout this new feature branch locally
- Assumes you have already checked out Master and Develop branches for this repository
- Assumes you have initialized GitFlow locally for this repository (after checkout of Master AND Develop)
- Commit changes to feature and push to the origin
- Create pull request for feature to develop within Jira
- Optionally you can do it in Bitbucket or in Step 3 as part of the commit (see options in SourceTree Commit)
- Another person performs code review
- After it meets their approval they will Approve the pull request in BitBucket
- They will not perform the merge. This is left to the person who initiated the pull request.
- Before performing the Merge in BitBucket do a Finish Feature in SourceTree.
- The goal is to only merge to Develop and delete your local branch
- Don't do it via Visual Studio or Command line as it will delete the remote feature branch and the pull request will be cancelled.
- In VS there is a checkbox to delete remote feature branch so just don't check it.
- Merge pull request in BitBucket
- Check option to delete source branch after merge
- The feature branch will be cleaned up on the origin only
- Cleanup local repo
- In SourceTree on Develop you will have your commit still. Since you committed in BitBucket in step 7 we need to gracefully cleanup your local workspace
- If you try to push you will get denied since this commit is not via a pull request or saying you can't push because you don't have latest from origin/remote
- Do a Pull and check Rebase instead of merge
- This will sync local with remote and the FEATURE WILL BE FINISHED!
![]() |
The process in visual form. |
Let me know if you have any questions around it!
No comments:
Post a Comment