Made compliant with the Jon Skeet Decree - <https://twitter.com/PeterMortensen/status/976400000942034944>, etc.
Source Link
Peter Mortensen
  • 29k
  • 21
  • 97
  • 124

Tip: When you delete branches using

git branch -d <branchname> # deletesDeletes local branch

or

git push origin :<branchname> # deletesDeletes remote branch

only the references are deleted. Even though the branch is actually removed on the remote, the references to it still exists in the local repositories of your team members. This means that for other team members the deleted branches are still visible when they do a git branch -a.

To solve this, your team members can prune the deleted branches with

git remote prune <repository>

This is typically git remote prune origin.

Tip: When you delete branches using

git branch -d <branchname> # deletes local branch

or

git push origin :<branchname> # deletes remote branch

only the references are deleted. Even though the branch is actually removed on the remote the references to it still exists in the local repositories of your team members. This means that for other team members the deleted branches are still visible when they do a git branch -a.

To solve this your team members can prune the deleted branches with

git remote prune <repository>

This is typically git remote prune origin.

Tip: When you delete branches using

git branch -d <branchname> # Deletes local branch

or

git push origin :<branchname> # Deletes remote branch

only the references are deleted. Even though the branch is actually removed on the remote, the references to it still exists in the local repositories of your team members. This means that for other team members the deleted branches are still visible when they do a git branch -a.

To solve this, your team members can prune the deleted branches with

git remote prune <repository>

This is typically git remote prune origin.

deleted 3 characters in body
Source Link
Anant Kumar Singh
  • 67.1k
  • 10
  • 47
  • 89

Tip: When you delete branches using

git branch -d <branchname>    # deletes local branch

or

git push origin :<branchname> # deletes remote branch

only the references are deleted. Even though the branch is actually removed on the remote the references to it still exists in the local repositories of your team members. This means that for other team members the deleted branches are still visible when they do a git branch -a.

To solve this your team members can prune the deleted branches with

git remote prune <repository>

This is typically git remote prune origin.

Tip: When you delete branches using

git branch -d <branchname>    # deletes local branch

or

git push origin :<branchname> # deletes remote branch

only the references are deleted. Even though the branch is actually removed on the remote the references to it still exists in the local repositories of your team members. This means that for other team members the deleted branches are still visible when they do a git branch -a.

To solve this your team members can prune the deleted branches with

git remote prune <repository>

This is typically git remote prune origin.

Tip: When you delete branches using

git branch -d <branchname> # deletes local branch

or

git push origin :<branchname> # deletes remote branch

only the references are deleted. Even though the branch is actually removed on the remote the references to it still exists in the local repositories of your team members. This means that for other team members the deleted branches are still visible when they do a git branch -a.

To solve this your team members can prune the deleted branches with

git remote prune <repository>

This is typically git remote prune origin.

Copy edited.
Source Link
Peter Mortensen
  • 29k
  • 21
  • 97
  • 124

Tip: When you delete branches using

git branch -d <branchname>    # deletes local branch

or

git push origin :<branchname> # deletes remote branch

only the references are deleted. Even though the branch is actually removed on the remote the references to it still exists in the local repositories of your team members. This means that for other team members the deleted branches are still visible when they do a git branch -a.

To solve this your team members can prune the deleted branches with

git remote prune <repository>

thisThis is typically git remote prune origin.

Tip: When you delete branches using

git branch -d <branchname>    # deletes local branch

or

git push origin :<branchname> # deletes remote branch

only the references are deleted. Even though the branch is actually removed on the remote the references to it still exists in the local repositories of your team members. This means that for other team members the deleted branches are still visible when they do a git branch -a.

To solve this your team members can prune the deleted branches with

git remote prune <repository>

this is typically git remote prune origin.

Tip: When you delete branches using

git branch -d <branchname>    # deletes local branch

or

git push origin :<branchname> # deletes remote branch

only the references are deleted. Even though the branch is actually removed on the remote the references to it still exists in the local repositories of your team members. This means that for other team members the deleted branches are still visible when they do a git branch -a.

To solve this your team members can prune the deleted branches with

git remote prune <repository>

This is typically git remote prune origin.

Improved formatting, added syntax highlighting
Source Link
user456814
user456814
Loading
Clarified which branch (local or remote) is deleted by the two commands
Source Link
Loading
Explained that git push origin :branchname really deletes the branch remotely.
Source Link
pfrenssen
  • 5.2k
  • 1
  • 19
  • 15
Loading
added 14 characters in body
Source Link
pfrenssen
  • 5.2k
  • 1
  • 19
  • 15
Loading
Source Link
pfrenssen
  • 5.2k
  • 1
  • 19
  • 15
Loading