Git flow with Bitbucket pull requests
Asked Answered
C

2

0

I used git flow feature finish to finish a feature branch. I use the AVH fork of git-flow, which deletes the remote feature branch - but the Bitbucket pull request is still open. How should I close the Bitbucket pull request?

And what is a correct way to accept a PR in future while following the git flow workflow?

Cutler answered 30/6, 2015 at 10:1 Comment(0)
C
2

While the AVH version of git-flow deletes the remote feature branch when you do git flow feature finish, strangely, it doesn't push anything. It leaves you on the master branch, so once you've done git push or git push origin master:master, the BitBucket pull request will automatically be marked as merged, which closes it. It is not necessary to amend the commit message - it works with the standard commit message.

Cutler answered 30/6, 2015 at 10:1 Comment(0)
S
0

The AVH version of git-flow has some additional features: https://github.com/petervanderdoes/gitflow-avh

It has support for hooks (custom scripts): https://github.com/petervanderdoes/gitflow-avh/wiki/Reference:-Hooks-and-Filters#hooks

You can swap to the AVH version on a Mac using:

brew uninstall git-flow
brew install git-flow-avh

To support a pull request in git flow you can add a script:

.git/hooks/post-flow-feature-publish.sh

When running the command:

git flow feature my-feature publish

Git flow will push code to the feature branch and call the hook script to create the PR.

Stepmother answered 19/10, 2020 at 23:50 Comment(2)
thanks for this but where can we find the post-flow-feature-publish.sh ? not everyone is familiar with the Github or Bitbucket APIRoughage
The script has to be written, I'm not aware of any open-source versions. But there should be!Stepmother

© 2022 - 2024 — McMap. All rights reserved.