-
Revert the main branch to a previous commit
-
Create and switch to a new branch
git switch -c path_config
# Switched to a new branch 'path_config'
- List all local branches
git branch --all
- List all the remote brances
git branch -r
- Reset all changes after last commit
Undo chnages to tracked file:
git reset HEAD --hard
- Remove GIT History (Caution it delete all the commit history)
git checkout --orphan last
git add -A
git commit -am "fresh init"
git branch -D main
git branch -m main
git push -f origin main
- Bare repository
git clone --mirror [email protected]:lifeparticle/binarytree.git
- Log
git log --oneline
- Git bisect
git bisect start
git bisect bad
git bisect good
- Reduce Git repository size
git clone --mirror [email protected]:lifeparticle/binarytree.git
bfg --strip-blobs-bigger-than 1M binarytree.git
cd binarytree.git