Initialize
git init .
Create your first commit (step required):
git commit --allow-empty -m "Initial commit"
the default name is in field:
init.defaultbranch=main" in: git config -l
Check the config list:
git config --list
Create a new branch:
git branch branch1
List all branches and check where are now:
git branch -l git branch –list
Change branch, to main, in this case:
git checkout main
Change branch, to branch1, in this case:
git checkout branch1
Create and change branch in 1 command:
git checkout -b my-new-branch
Set the user.name config:
git config --global user.name "
jamechothepuppy
" (jamechothepuppy is my name)
Set the user.email config:
git config --global user.email "
jamechothepuppy
@example.com"
To add files to stagging area:
git add <file>
To commit (from stagging area to local repo):
git commit -m "feature implemented"
No need to push, because is local (at least for now).
The “.git” folder in a repository represents the local repository itself, not the staging area.
that’s all, enjoy.