0

I don't use Git that often so bear with me, please. From my origin main branch repository in GitHub, I locally created a new branch (feature-typescript) using Git. I have staged and committed my files within the feature-typescript branch. I'm thinking there might be a lot of feature-[name] branches. So instead of having multiple branches with the same beginning name, I would like to put them in a directory to make my remote repository branch category more organized.

I have tried to create a branch directory named feature within my remote repository but I'm not able to figure out how. Is there a way I can create a new directory named feature to my GitHub repository using Git?

One last thing I want to add that I'm confused about. As I mentioned earlier, I have already staged and committed my feature-typescript branch. I tried to push it to my remote repository but I get this error:

fatal: The current branch feature/typescript has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin feature/typesccript

Can anyone explain the reason for this? Thank you in advance!

Jacob Lee
  • 4,405
  • 2
  • 16
  • 37
K. Pham
  • 47
  • 1
  • 11
  • 4
    There isn't anything like a branch directory. Simply name your branch 'feature/whatever' and use slashes instead of the minus. That's it. – Oliver Jul 17 '22 at 08:40
  • https://stackoverflow.com/search?q=%5Bgit%5D+The+current+branch+has+no+upstream+branch – phd Jul 17 '22 at 08:42
  • 1
    As for the second question, simply use the command provided: `$ git push --set-upstream origin feature/typescript`. – Jacob Lee Jul 17 '22 at 08:42

0 Answers0