-1

I usually create feature branches and then raise PR against release branch .

I have created multiple branches now and raised PRs . I dont want to see them when I give command git branch . how to delete the history of all my created branches

Gajukorse
  • 147
  • 2
  • 11
  • _I dont want to see them when I give command `git branch`_ -- Do you delete local branches with `git branch -d`? Additionally, what does "delete the history of all my created branches" mean exactly? – terrorrussia-keeps-killing Dec 18 '20 at 11:48
  • 1
    You just need to delete the branches. Unreferenced commits in the GIT repo will no longer appear and will (eventually) get cleaned up. Depending on what merge you've used they may be referenced by the head branch in which case you can't "delete the history" as the commits are still referenced. If you want this kind of flow you should use a squash merge not a standard one. – Liam Dec 18 '20 at 11:57
  • 1
    https://stackoverflow.com/search?q=%5Bgit%5D+delete+branch – phd Dec 18 '20 at 11:59

1 Answers1

0
git branch -d branchname

This will delete the branch locally so it won't show in git branch.

grg
  • 5,023
  • 3
  • 34
  • 50