jon lee
jon lee

Reputation: 887

Git flow and Github

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?

Upvotes: 6

Views: 2609

Answers (1)

VonC
VonC

Reputation: 1323135

So fork/pull should be kept separate from git flow?

Yes:

The Atlassian tutorial on workflows has therefore two sections:

gitflow

forks workflow

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:

  • gitflow: common access to a blessed Git repo, where all the developers can push to (and must agree on the branch and merge convention)
  • forking workflow: no access to one common repo, hence the need for a fork (a repo which one developer owns and can push to), with asynchronous contributions back to the original repo through pull requests.

Upvotes: 16

Related Questions