-2

Even if I run delete branch both locally and remotely, inevitably I still see all those deleted branch whenever I run command 'git branch -a'

I want to delete all those branches forever. How could I achieve this?

verystrongjoe
  • 3,219
  • 8
  • 28
  • 55
  • What command did you use in deleting the branch(s). – Chukwuemeka Inya Sep 15 '18 at 05:36
  • @caramba it is not working prune is said as unknown option. – verystrongjoe Sep 15 '18 at 06:00
  • 1
    Is it showing up as a remote branch? How did you delete it remotely? By going into the remote machine and deleting the branch from the repo "locally"? Then you have to run `git fetch --prune` so that your local repo notices that the branch has been deleted on the remote. – eftshift0 Sep 15 '18 at 06:02
  • https://stackoverflow.com/search?q=%5Bgit%5D+remove+branch – phd Sep 15 '18 at 08:39

1 Answers1

1

In case of when you delete git push --delete to remove remote branch, I found out that those branches still exists in local repositories so that, I could delete git fetch --prune command for help from @etfshift0 above

SDS@DESKTOP-4F1KJ89 MINGW64 /d/dev/workspace/trading-gym (development)
$ git branch -a
* development
  feature-add-core-util
  feature-add-util-in-ioutil
  feature-change-varible
  feature-fixbug-import
  gh-pages
  master
  remotes/origin/YIJ
  remotes/origin/development
  remotes/origin/feature-add-core-util
  remotes/origin/feature-add-util-in-ioutil
  remotes/origin/feature-change-varible
  remotes/origin/feature-fixbug-import
  remotes/origin/fixed_episode_duration_min
  remotes/origin/gh-pages
  remotes/origin/master
  remotes/origin/taehyunjo-patch-1
  remotes/origin/taehyunjo-readme

SDS@DESKTOP-4F1KJ89 MINGW64 /d/dev/workspace/trading-gym (development)
$ git fetch --prune
From https://github.com/6-Billionaires/trading-gym
 - [deleted]         (none)     -> origin/feature-add-core-util
 - [deleted]         (none)     -> origin/feature-add-util-in-ioutil
 - [deleted]         (none)     -> origin/feature-change-varible
 - [deleted]         (none)     -> origin/feature-fixbug-import
 - [deleted]         (none)     -> origin/fixed_episode_duration_min

SDS@DESKTOP-4F1KJ89 MINGW64 /d/dev/workspace/trading-gym (development)
$ git branch -a
* development
  feature-add-core-util
  feature-add-util-in-ioutil
  feature-change-varible
  feature-fixbug-import
  gh-pages
  master
  remotes/origin/YIJ
  remotes/origin/development
  remotes/origin/gh-pages
  remotes/origin/master
  remotes/origin/taehyunjo-patch-1
  remotes/origin/taehyunjo-readme

SDS@DESKTOP-4F1KJ89 MINGW64 /d/dev/workspace/trading-gym (development)
$
verystrongjoe
  • 3,219
  • 8
  • 28
  • 55