user482745
user482745

Reputation: 1214

Is it safe to delete local main branch?

Is it safe to delete the localmain branch?

Given: My workflow does not use the local main branch. There are no local commits on local main.

I do not have any use for my local main branch. Does git itself depend on the existence of the main branch? E.g. Can a git command fail if no local main branch is present?

Context: I will always create a feature branch from origin/main and push it (optionally deleting it). I am too lazy to keep local main updated, but not comfortable keeping local main behind origin/main. Do you see the dilemma?! :)

Upvotes: 3

Views: 2294

Answers (1)

Frederik
Frederik

Reputation: 66

As long as the remote main is still available and you are not deleting it with the localmain branch it is no problem to do so. But you have to be absolutely sure not to delete the remotemain ;)

Upvotes: 5

Related Questions