0

I am working with a remote team and I am being asked to do following:

For creating any branch for bug fix cerate it as 'hotfix/BUGFIX_NAME'

For any feature branch create it as 'feature/FEATURE_BRANCH_NAME'

create individual branches by your names separately work on your named branch and create any branch of your task under it. once you merge any task in your named branch, you can merge it in the current feature branch or hotfix branch

I need to work on featureA so I will be doing:

git checkout -b myname/featureA

In future I need to create more features so I may do:

git checkout -b myname/featureB

Is it common/right way to name branches this way or should I do below:

git checkout -b myname

then:

git checkout -b featureA myname
git checkout -b featureb myname

Referenced articles before posting:

SO Question

Git branch names supports forward slashes

Github discussion

So my question is that am I doing what is right way as per instructions and what should be done?

I apologize if my question is too much subjective and could not be useful for anyone else. Need help before I mess up! :)

Thanks!

Community
  • 1
  • 1
Always_a_learner
  • 4,585
  • 13
  • 63
  • 112
  • 1
    The second part of those instructions ("create individual branches by your names…") isn't clear to me. You'd probably be better served asking for clarification from the person who sent you the instructions than here. – ChrisGPT was on strike Aug 23 '18 at 14:00
  • 1
    If your instructions are unclear you need to ask those giving you those instructions. If they're unclear to you, you're going to present us with an unclear picture, and then they're unclear to us as well. – Lasse V. Karlsen Aug 23 '18 at 14:01
  • 1
    I agree with previous comments, that these instructions need to be clarified with whoever sent them - especially because there is no universal "right" naming convention. (If they have authority over the project's repo, then their way is "right" and you need to understand it.) I will add, though, that branch naming and branch/merge topology are two very separate things, and you seem to be conflating them. – Mark Adelsberger Aug 23 '18 at 14:03
  • Thank you Chris, Lasse Vågsæther Karlsen, Mark Adelsberger for your time and suggestion. I was thinking that may be I am not able to understand it well as I don't have adequate knowledge of GIT. Therefore I thought I can take some expert advice before communication further with remote team as asking a naive question might land me in trouble. I will modify my post or rather close it after communication with team, for time being I will wait for further comments/answers. – Always_a_learner Aug 24 '18 at 05:27

1 Answers1

3

None of the ways mentioned in the question is wrong.

As I understand, the team wants to

Set a namespace to avoid conflicting branch names among the remote developers

IMHO, It is better to follow the convention set in the team, so everybody is on the same page, and trivial issues/problems can be avoided.

nkshio
  • 1,060
  • 1
  • 14
  • 23
  • Thanks @mehtankush for answering my unclear question. Much appreciated. Are able to relate the first two lines and the 3rd one (para) of instructions. Why would I create a branch like git checkout -b myname/featureA develop and then merge it into feature/featureA if no one is working on featureA? thanks for your time :) – Always_a_learner Aug 24 '18 at 05:41