Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A problem with GitFlow is it's painful to follow PR model.

Especially on the Github repository where pushing to master is a lock and can only done by PR and merge(or squash or whatever).

Let's take a look at a release:

1. Branch of release/1.0 from develop 2. Fix some bug, then at the time of deploymennt. Merge it back to master and develop

But once we merge, github close the PR... If we attempt to create another PR for other branch. The Github now see different history between master/develop...



There exist scripts and workflows to perform auto-merges from all release branches back to master. This way, you only have to care about branching off releases, and hotfixes will automatically land on develop once released.

(Assuming master is your "next release", and develop is your main development branch)


Like I said, I cannot merge because we cannot push from our computer to Github(It's locked).

The only way to get code into branch is by doing a PR, and click merge button on Github UI. But a PR cannot be merged twice.

And If I open two PRs two master/develop then I will see this kind of error on Github: "This branch is 1 commit behind. 1 commit ahead of develop"


the way to go here is probably creating an "administrator" account which is used by those merging scripts, and allow push access to protected branches for administrators.


So, on my team, juniors can create feature branches and easily deploy a feature branch to a ‘staging’ server.

If the feature is deemed good, an ‘admin’ will ‘finish’ the feature and it is merged into develop branch.

Then, when we are ready for a release, the ‘admin’ will create a release and both develop and master are updated.

Updating master triggers a webhook that deploys the release.

For a hotfix, the release step is skipped, but both develop and master are updated, again causing the webhook to trigger a deployment.


Is Gitflow meant to be used with pull requests?

I do not use it that way, but I am open-minded to its advantages.


I guess it isn't well suit for pull requests model. At least, with Github Pull Request.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: