Removed fluff (For future reference, "Happy Coding" is considered fluff as it adds "noise" to the post; for more information, have a look through the post - https://meta.stackoverflow.com/questions/260776/should-i-remove-fluff-when-editing-questions)
Source Link
Nimantha
  • 5.3k
  • 5
  • 18
  • 50

It's very simple:

To delete the remote branch

git push -d origin <branch-name>

Or

git push origin :<branch-name>

-- You can also delete tags with this syntax

To forcefully delete local branch

git branch -D <branch-name>

Note: do a git fetch --all --prune on other machines after deleting remote branch, to remove obsolete tracking branches.

Example

to remove local branch

git branch -D my-local-branch

to remove remote branch

git push origin :my-remote-branch

Happy Coding :)

It's very simple:

To delete the remote branch

git push -d origin <branch-name>

Or

git push origin :<branch-name>

-- You can also delete tags with this syntax

To forcefully delete local branch

git branch -D <branch-name>

Note: do a git fetch --all --prune on other machines after deleting remote branch, to remove obsolete tracking branches.

Example

to remove local branch

git branch -D my-local-branch

to remove remote branch

git push origin :my-remote-branch

Happy Coding :)

It's very simple:

To delete the remote branch

git push -d origin <branch-name>

Or

git push origin :<branch-name>

-- You can also delete tags with this syntax

To forcefully delete local branch

git branch -D <branch-name>

Note: do a git fetch --all --prune on other machines after deleting remote branch, to remove obsolete tracking branches.

Example

to remove local branch

git branch -D my-local-branch

to remove remote branch

git push origin :my-remote-branch
added examples to remove branches
Source Link
Vivek Maru
  • 6.1k
  • 1
  • 18
  • 28

It's very simple:

To delete the remote branch

git push -d origin <branch-name>

Or

git push origin :<branch-name>

-- You can also delete tags with this syntax

To forcefully delete local branch

git branch -D <branch-name>

Note: do a git fetch --all --prune on other machines after deleting remote branch, to remove obsolete tracking branches.

Example

to remove local branch

git branch -D my-local-branch

to remove remote branch

git push origin :my-remote-branch

Happy Coding :)

It's very simple:

To delete the remote branch

git push -d origin <branch-name>

Or

git push origin :<branch-name>

-- You can also delete tags with this syntax

To forcefully delete local branch

git branch -D <branch-name>

Note: do a git fetch --all --prune on other machines after deleting remote branch, to remove obsolete tracking branches.

Happy Coding :)

It's very simple:

To delete the remote branch

git push -d origin <branch-name>

Or

git push origin :<branch-name>

-- You can also delete tags with this syntax

To forcefully delete local branch

git branch -D <branch-name>

Note: do a git fetch --all --prune on other machines after deleting remote branch, to remove obsolete tracking branches.

Example

to remove local branch

git branch -D my-local-branch

to remove remote branch

git push origin :my-remote-branch

Happy Coding :)

some addition
Source Link
Vivek Maru
  • 6.1k
  • 1
  • 18
  • 28

It's very simple:

To delete the remote branch

git push -d origin <branch-name>

Or

git push origin :<branch-name>

-- You can also delete tags with this syntax

To forcefully delete local branch

git branch -D <branch-name>

Note: do a git fetch --all --prune on other machines after deleting remote branch, to remove obsolete tracking branches.

Happy Coding :)

It's very simple:

To delete the remote branch

git push -d origin <branch-name>

Or

git push origin :<branch-name>

To forcefully delete local branch

git branch -D <branch-name>

Note: do a git fetch --all --prune on other machines after deleting remote branch, to remove obsolete tracking branches.

Happy Coding :)

It's very simple:

To delete the remote branch

git push -d origin <branch-name>

Or

git push origin :<branch-name>

-- You can also delete tags with this syntax

To forcefully delete local branch

git branch -D <branch-name>

Note: do a git fetch --all --prune on other machines after deleting remote branch, to remove obsolete tracking branches.

Happy Coding :)

added 130 characters in body
Source Link
Vivek Maru
  • 6.1k
  • 1
  • 18
  • 28
Loading
added 19 characters in body
Source Link
Vivek Maru
  • 6.1k
  • 1
  • 18
  • 28
Loading
Indicate what the -D flag actually does
Source Link
Edric
  • 19.9k
  • 12
  • 72
  • 83
Loading
Active reading [<https://www.youtube.com/watch?v=1Dax90QyXgI&t=19m05s>]. [(its = possessive, it's = "it is" or "it has". See for example <http://www.wikihow.com/Use-Its-and-It%27s>.)]
Source Link
Peter Mortensen
  • 29.1k
  • 21
  • 97
  • 124
Loading
added 44 characters in body
Source Link
Vivek Maru
  • 6.1k
  • 1
  • 18
  • 28
Loading
deleted 5 characters in body
Source Link
Vivek Maru
  • 6.1k
  • 1
  • 18
  • 28
Loading
added 6 characters in body
Source Link
Vivek Maru
  • 6.1k
  • 1
  • 18
  • 28
Loading
Source Link
Vivek Maru
  • 6.1k
  • 1
  • 18
  • 28
Loading