1

I am working on a project and we use Git for scm. We have a ticketing/issue system for the project that we use for bug fixes and features, and refactoring. I am currently working on a ticket and have a local branch named after that ticket. I have merged my changes onto the branch and issued a merge/pull request to the project lead. However, he is delayed and I want to move onto the next ticket. I figure I can create a new branch based on the second ticket name and wait for the prior branch to be merged. However, I am new enough at working this way that I am not sure what I need to consider before using this strategy.

2 Answers 2

1

Yes, you can branch from a specific branch. If you have existing_branch and are creating new_branch, the command would be git checkout -b new_branch existing_branch.

Full git checkout documentation and options can be found at https://git-scm.com/docs/git-checkout

Sign up to request clarification or add additional context in comments.

Comments

1

Assuming your second new branch has no dependencies on your first branch, you normally want to create the new branch from a stable commit. This is usually either the HEAD of the master branch or the latest release tag. If you created your new branch from your first branch, you might end up having to merge any PR review changes from the first branch into your second new branch.

Different teams may have adapted different approach. Your best bet is to ask your teammates.

2 Comments

Thanks! Yes, the second branch was created from master of my fork of the project.
Then you should be good. Please consider accepting the answer if you liked it.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.