<mohammadrony>

Branches

Setup Default Initial Branch

git config --global init.defaultBranch main

Create and Switch to New Branch

git branch feature
git checkout feature

Or

git checkout -b feature

List branches

Local branches

git branch

Remote branches

git branch -r

Rebase changes with Other Branch

Receive updated changes from main branch to feature branch.

git checkout feature
git rebase main

Merge feature Branch to main Branch

git checkout feature
git add .
git commit -m "Update feature"
git checkout main
git merge feature

Delete branch

git branch -d feature
git push origin :feature