Definitions

Git_Introduction


CommandExplanationUse-Case
git add .”Staging” of changes in current directory
git commit -mCreate new commit with message-flag
git branch newBranchCreates a new branchHere: creates ‘newBranch’
git checkout newBranchMove to other branchHere: moves to ‘newBranch’
git merge newBranchCombines two branchesHere: combining ‘newBranch’ & ‘main’
git rebase mainMoves commits from current branch in other branch - new linear historyHere: combining ‘newBranch’ & ‘main’

Removing cached files:

git rm -r --cached