3

I am currently learning git and github. So, I made a new repository for my e-commerce project. As I found that I can commmit and sync changes using the vscode and I made commits and synced the changes from there. But If I did from there I says I am working on main branch.

I want to know the difference of the main and master branch in github. Do we miss some features in main branch that is in master branch?

  • 1
    They are conceptually the same thing. The convention just changed: previously the primary branch was called `master` and for newer repository that defaults to `main`. You should only ever have one of those in a single repository (nothing breaks if you have both, but it's unlikely to be intentional). – Joachim Sauer Jan 18 '23 at 08:27
  • 2
    Same difference between your `foo` and `bar` variables in any language: they're just different identifiers. – Romain Valeri Jan 18 '23 at 08:29

1 Answers1

3

There is no functional difference in and of itself. Any difference for your workflow stems from the way you use and design your repo.

The git documentation states in the options for git init (i.e. creating a new repo):

--initial-branch=

Use the specified name for the initial branch in the newly created repository. If not specified, fall back to the default name (currently master, but this is subject to change in the future; the name can be customized via the init.defaultBranch configuration variable).

(Emphasis mine)