Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in DevOps and Agile by (19.7k points)

I've accidentally pruned some remote branches and I don't really know what the consequence of this is (I clicked the "Prune remote branches" button in Git Extensions, thinking it would delete a remote branch).

The official documentation says "git-prune - Prune all unreachable objects from the object database ". I don't really understand what this means. I'm guessing this might have removed merged branches but I'm not really sure.

1 Answer

+1 vote
by (62.9k points)

The git prune command is an internal housekeeping utility that deletes lost or "orphaned" Git objects. Unreachable objects are those that are inaccessible by any refs. Any commit that cannot be accessed through a branch or tag is considered unreachable or not present. git prune is generally not executed directly. Prune is known as a garbage collection command and is a child command of the git gc command.

Related questions

0 votes
2 answers
asked Jul 24, 2019 in DevOps and Agile by chandra (29.3k points)
0 votes
1 answer
asked Dec 8, 2020 in DevOps and Agile by dev_sk2311 (45k points)
0 votes
1 answer
asked Dec 8, 2020 in DevOps and Agile by dev_sk2311 (45k points)
0 votes
1 answer

Browse Categories

...