vpoola88
vpoola88

Reputation: 3999

Git Workflow on related branches?

I have a question about git's work flow. I've found some guides, but maybe you guys can clarify this for me.

Alright so the normal workflow that we are using in our department/project is:

  1. Master branch for big releases
  2. Dev branch for constant updating, which is merged to master for those big releases every month or so
  3. Features branches for all the issues we are tackling, that are pushed/merged to the dev branch once each feature is done and rebased into 1 commit.

So where I am having trouble is understanding on how to work on a branch that is dependant on another branch. To clarify:

file A has information for issues 1 and 2. Say I work on issue 1, and push that branch to be merged with dev. How do I work on issue 2, then once dev accepts the pull request from issue 1, update the code for issue 2 and then push to dev as a seperate issue.

I know that is a bit confusing so please let me know if I need to clarify.

I'm not sure if this is similar to what I am talking about :How to handle dependencies when using git topic branch workflow?

Upvotes: 0

Views: 63

Answers (2)

QuestionEverything
QuestionEverything

Reputation: 5097

Take a look at this. I find it really awesome.

Upvotes: 1

user2109908
user2109908

Reputation:

In this example, let's say that you are working on HTML in one branch (feature/html), and the CSS in another branch (feature/css). Additionally, you mentioned that there is a dev branch and a master branch. Let's say that you push two commits to feature/html but you don't merge those changes up to dev.

If you want to work on the feature/css branch with the changes that you have committed into feature/html, you would simple merge the changes from feature/html into feature/css. You would do this with the following command:

$ git checkout feature/css # If you aren't already in the feature/css branch
$ git merge feature/html

Upvotes: 1

Related Questions