Reputation: 51
Imagine you just created a new branch, added some commits and noticed you messed up. Can you now just delete the (not merged) branch to undo your changes?
Talking about the regular Github page.
Thanks!
Upvotes: 0
Views: 1080
Reputation: 1842
If you are using branches, then you should be aware of the branching pattern you are using:) Most people use some sort of trunk branch (master/main/develop) and feature or story branches. Whether you use PRs to merge or just merge and push locally is probably irrelevant here.
On that basis, code on a branch makes no difference to the trunk itself and whether you choose to delete the branch or just leave it on github and allow to wither is of little difference - there are pros to leaving the code there. Whatever, if somebody else has cloned the repo, they will have a copy and might have started to use it - thus the distributed nature of git.
There are two potential places I can think of where there may be issues:
Upvotes: 0
Reputation: 3255
It is gone from origin
, meaning the main version of your repo, meaning the version that is on GitHub.com. However, someone might have had time to clone the repo and checked out that branch in their clone. Then that branch exist in the clone regardless what you do to origin
if that is important. Including your own clone.
(Technically something else can be origin
but I am assuming here that you do not have some advanced set up. What I assume would be the case if you have created your repo on GitHub.com and not changed any advanced settings.)
Upvotes: 0