Useful Git CLI Command
CI/CD
These are a few useful git command that I have learned:
- To see all & delete the branch with prefixes, make sure to change
PREFIX
and$3
accordingly.Bash
index
git branch -r | awk -F/ '/\/{PREFIX}/{print $2 "/" $3}' // To list out all the branch before delete git branch -r | awk -F/ '/\/PREFIX/{print $2 "/" $3}' | xargs -I {} git push origin :{} // to delete
- Reset commit that did not sync yet
Bash
index
git reste ~HEAD