Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bitbucket how to return branch from "merged" into "active"

i had master branch (with the production version)

i had test branch for the development needs

decided to make master for the development needs

test for the pre production tests on real server equal for production

prod branch for the code passed test branch - really production code

What i did through bitbucket interface:

  1. from the master branch was created prod branch (to have in it current production version of the code)
  2. then i merged test branch into the master (to have in master my current development) at this moment bitbucket decided that test and prod branches not required anymore and marked them as "merged" and removed them from the "active" branches list, BUT i need them !!!

as a solution i see following:

  1. create test branch from the current master - since they are equal at the moment
  2. on my local PC from the local master create branch prod and push it to the bitbucket (i think when i was cloning repository i wasnt influenced by the .gitignore, right ? so my local master has the state of the origin/master before merge)

please answer me if I'm right about the solution and have another question:

is there a way to restore my branches from the "merged" to "active" by means of bitbucket in case this happen again ?

P.S.: may be i shouldn't do anything with them, because they are still available in pull request dropdowns, so i can merge other branches with them and if i do so, they (prod and test branches) again appear in the active branches list ?

like image 999
Eugene Avatar asked Aug 26 '16 12:08

Eugene


Video Answer


2 Answers

If you hover your mouse over Active or Merged tabs, there are tooltip(s) that explain their purpose:

Merged: Branches that are not ahead of the main branch

Active: Branches that are ahead of the main branch

So if the main/master branch already includes everything that is there in the branch in question (for example, a brand new branch), then it is shown in the Merged tab.

like image 150
Anupam Avatar answered Oct 26 '22 06:10

Anupam


so the problem looks like not exist. bitbucket just scared me a bit, all branches exists where they should, bit bucket just decided to kind of "soft replace" branches in it interface from active to merged.

$ git branch -a

*master
test

remotes/origin/HEAD -> origin/master
remotes/origin/prod
remotes/origin/test
like image 40
Eugene Avatar answered Oct 26 '22 05:10

Eugene