I am struggling to understand how Git flow works with Github.
Github allows the fork/pull request model of integrating changes, where the entire upstream repo and all its branches are copied into the fork.
Then using git flow, I would branch off of a dev branch say and then when finished my changes would be merged into the dev branch of my fork not the upstream. So when a pull request is made back the upstream repo, it merges dev(fork) to dev(upstream) but this loses all knowledge of my feature branch etc ever existed.
So for Git flow to work properly, would I need to stop forking the repo and create feature branches directly in the upstream repo?
So fork/pull should be kept separate from git flow?
GitHub proposes an alternate workflow called GitHub Flow. GitHub Flow has some of the same elements as Git Flow, such as feature branches. But unlike Git Flow, GitHub Flow combines the mainline and release branches into a “master” and treats hotfixes just like feature branches.
The GitHub flow is useful for everyone, not just developers. For example, here at GitHub, we use GitHub flow for our site policy, documentation, and roadmap.
Unlike Git-Flow, GitHub-Flow involves no release branches. In the ideas of GitHub-Flow, once a version is ready to go, it can be deployed. Similarly, GitHub-Flow believes that hotfixes are identical to minor feature changes, and their processing methods should be similar.
So fork/pull should be kept separate from git flow?
Yes:
The Atlassian tutorial on workflows has therefore two sections:
Just want to know whether git-flow should be used in the upstream or a fork.
It's not making sense to me to use git-flow in a fork as you lose all the info when merging back into the upstream repo
Exactly: trying to merge the two workflows doesn't make sense as both are used for different need:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With