Skip to content

Instantly share code, notes, and snippets.

View myusrilh's full-sized avatar

Muhammad Yusril Hasriansyah myusrilh

View GitHub Profile
@myusrilh
myusrilh / GitDeleteCommands.ps1
Created October 19, 2020 04:37 — forked from cmatskas/GitDeleteCommands.ps1
Git Delete Branch commands
## Delete a remote branch
$ git push origin --delete <branch> # Git version 1.7.0 or newer
$ git push origin :<branch> # Git versions older than 1.7.0
## Delete a local branch
$ git branch --delete <branch>
$ git branch -d <branch> # Shorter version
$ git branch -D <branch> # Force delete un-merged branches
## Delete a local remote-tracking branch