1

To temporarily test differences in node modules between me and my team mate I created a branch and committed the node_modules folder. Since there was not an issue we never merged the branch, but it is still in the history, increasing the git size from 1Mb to 70Mb...

How can I permanently remove the branch with the commit from git history? It is already pushed to our gitlab remote.

Raymundus
  • 2,173
  • 1
  • 20
  • 35
  • 1
    Just delete the branch, and the contents will eventually (two weeks, I believe) disappear via Git's garbage collection. See [git gc](https://git-scm.com/docs/git-gc). – Amadan Jul 05 '18 at 08:54
  • 1
    `git push origin :branch_name` will delete the branch. – Maroun Jul 05 '18 at 08:54
  • 2
    Double check that the commits are unreachable. https://stackoverflow.com/questions/3765234/listing-and-deleting-git-commits-that-are-under-no-branch-dangling – evolutionxbox Jul 05 '18 at 09:00

0 Answers0