I noticed the names "master" and "origin" being used a lot in git. What's the difference between these, and are either standard in git, or are they just common practice? Which would be the root folder of the repository?
Default is ' master '. Note that this must be a local branch name like 'master' or 'develop'.
The default branch name in Git is master . As you start making commits, you're given a master branch that points to the last commit you made. Every time you commit, the master branch pointer moves forward automatically. The “master” branch in Git is not a special branch.
Historically, the default name for this initial branch was master . This term came from Bitkeeper, a predecessor to Git. Bitkeeper referred to the source of truth as the "master repository" and other copies as "slave repositories".
No, the main branch can be any branch you want. By default, when you create a repository, the main branch is named the master branch. It is the base branch or the default branch. You can go through How to set up default branches in Git to know more.
master
is the default branch that is created in Git when you create a repo. It is pretty standard, but you may have a repo without master branch. You can delete or rename it, but it is generally not advised.
origin
is the remote from which you clone from and is set up by git. It is also pretty standard, but you may delete it or rename it or add a remote origin without cloning.
Note that all repos created in git come with master. But only cloned ones come with origin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With