Norfeldt
Norfeldt

Reputation: 9638

Git approach to branch into different projects (and continue using git flow)

I just became good friends with git and git flow and think I'm ready to take our relationship to the next level.

Say I have created a git repo that does an amazing job of displaying funny cat pictures. I use git flow to keep the control all my feature and hotfixes.

Then I get the awesome idea of doing an identical repo with funny dog pictures. What is the best git approach to branch off, change the pictures, continue to use git flow AND keep them in sync when I want a cross platform feature or hotfix?

Do I need to branch both "versions" off so I get

and then work in the Main repo and pull from the others

Or do I just branch it off

And do some git flow in each together with some merging?

Or is there a better option?

Upvotes: 0

Views: 39

Answers (1)

Marina Liu
Marina Liu

Reputation: 38096

Gitflow is restrict the workflow for different branches in a git repo (a branching model).

For a git repo, you can use the example gitflow as below:

  • master branch: version control production versions.
  • develop branch: develop new changes or make modification for the production versions. It should branch off from master branch.
  • feature branches: develop new features which should branch off from develop branch.
  • hotfix branches: fix bugs which should branch off from master branch.

For other Gitflows (branching models), you can refer Gitflow Workflow and A successful Git branching model.

For get changes from multiple repos:

If you need to get the changes from other repos into the git repo you are working, you can add other git repos as remotes for the repo you are working, and then cherry-pick/merge the changes from other repos into develop branch.

Upvotes: 1

Related Questions