Git Repository¶
- a local repository resides on your computer
- a shared repository resides on a remote service, e.g. GitHub, GitLab
Default branch¶
Git creates a default branch called main
~/.config/git/config
[init]
# default branch name when creating a new local repository
defaultBranch = main
Remote Branches¶
Use the --track flag with git checkout for remote branches that are not yet local.
Checkout a remote branch, creating a local branch of the same name
Output of Checkout Remote Branch
A local branch is created using the unqualified name of the remote branch, remote-branch-name. This local branch is used to track the remote branch, allowing changes to be pulled and pushed.