x

Git housekeeping commands

06 Aug 2021 / Oscar F
git commands knowledge

TLDR: git branch -d <branch name> # Local "safe" delete

git checkout master

Local branches

git branch

Remote branches

git branch -r

Branches merged into checked out branch (master)

git branch --merged

Local "safe" delete

git branch -d <branch name 1> <branch name 2> ...
git branch --no-merge

Remote "unsafe" delete

git push --delete origin <branch name 1> <branch name 2> ...
git remote prune origin --dry-run

References:

[1]: medium.com/@milan.brankovic/git-housekeeping Retrieved: 6 August 2021 20:00 Git housekeeping

[2]: Git Reference Retrieved: 6 August 2021 20:00 Git Reference

Twitter logo black LinkedIn logo black Facebook “f” logo black Reddit logo black Email icon black Print logo black