Gangmax Blog

How to Remove a Remote Git Branch

From here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 1. List all the branches(both local and remote).
git branch -a
# *master
# test
# remote/origin/master
# remote/origin/test

# 2. Remove the local branch.
git branch -d test
# Deleted branch test (was ########).

# 3. List all the branches(both local and remote).
git branch -a
# *master
# remote/origin/master
# remote/origin/test

# 4. Remove the remote branch.
git push origin --delete test
# To <URL of your repository>.git
# - [deleted] test

Comments