smeeb
smeeb

Reputation: 29567

GitFlow: show work vs do everything locally?

I've been trying to read up on and learn GitFlow and am trying to understand something.

I have always cut feature branches locally, worked on them, pushed them remotely (so as to show my work), submitted a PR and (eventually) merged my feature branches remotely.

GitFlow seems to prescribe a slightly different model:

  1. Cut feature branch locally
  2. Work locally
  3. Merge locally
  4. Push

I'm wondering what the advantages to this "do everything locally" strategy is?

Upvotes: 0

Views: 36

Answers (2)

Gary Ewan Park
Gary Ewan Park

Reputation: 19021

I personally always use the strategy that you have described, i.e. Work on the feature branch locally, push to origin and then submit a PR into the develop branch. This opens up the potential for code review and discussion.

I don't think GitFlow says anything about "having" to do everything locally, but rather it simply keeps the discussion around branches to the bare minimum so that it is easier to digest. How you actually implement it is up to you, and your team.

Upvotes: 1

Philippe
Philippe

Reputation: 31227

That's the same thing. The GitFlow tutorial is explaining to you how you should do in pure git and can't introduce all the other tools that can modify the workfkow.

They do all locally because git is a dvcs and do everything locally.

Ps: an even better workflow ;-)

  1. cut feature branches locally
  2. Do a first commit
  3. pushed them remotely
  4. submitted a PR (telling that it's a work in progress)
  5. work on them, push often and gather feedback (do 5. a lot of times)
  6. When finished, merged the PR.

Upvotes: 1

Related Questions