Can I recover a GitLab merge request for a deleted branch?












1















While doing some branch maintenance today, I lost a MR and the associated discussion. Not a tragedy but I'd like to get it back if possible. I found an open GitLab enhancement request to undo branch delete but that doesn't quite seem to be what I want. Here's what happened:



Branch A was pushed to our local installation of GitLab, an MR created, and some discussion ensued. We realized that A was a good start but we needed some significant refactoring. We hoped to keep the branch name for the work we'd ultimately merge/ship so we:




  • Created A-prime on the local system and pushed it to GitLab

  • Deleted A, hoping that the MR would be associated with the commits, not the branch. But when we deleted A, the MR was no longer accessible.

  • Recreated A at the same commit as it had been and pushed it to GitLab hoping the MR was hanging out and would get reassociated.


Clearly our mental model of GitLab is wrong. It seems that a post-commit hook or something deletes MRs as a branch is deleted. My question now is: can I get the deleted MR and its discussion back?










share|improve this question





























    1















    While doing some branch maintenance today, I lost a MR and the associated discussion. Not a tragedy but I'd like to get it back if possible. I found an open GitLab enhancement request to undo branch delete but that doesn't quite seem to be what I want. Here's what happened:



    Branch A was pushed to our local installation of GitLab, an MR created, and some discussion ensued. We realized that A was a good start but we needed some significant refactoring. We hoped to keep the branch name for the work we'd ultimately merge/ship so we:




    • Created A-prime on the local system and pushed it to GitLab

    • Deleted A, hoping that the MR would be associated with the commits, not the branch. But when we deleted A, the MR was no longer accessible.

    • Recreated A at the same commit as it had been and pushed it to GitLab hoping the MR was hanging out and would get reassociated.


    Clearly our mental model of GitLab is wrong. It seems that a post-commit hook or something deletes MRs as a branch is deleted. My question now is: can I get the deleted MR and its discussion back?










    share|improve this question



























      1












      1








      1


      1






      While doing some branch maintenance today, I lost a MR and the associated discussion. Not a tragedy but I'd like to get it back if possible. I found an open GitLab enhancement request to undo branch delete but that doesn't quite seem to be what I want. Here's what happened:



      Branch A was pushed to our local installation of GitLab, an MR created, and some discussion ensued. We realized that A was a good start but we needed some significant refactoring. We hoped to keep the branch name for the work we'd ultimately merge/ship so we:




      • Created A-prime on the local system and pushed it to GitLab

      • Deleted A, hoping that the MR would be associated with the commits, not the branch. But when we deleted A, the MR was no longer accessible.

      • Recreated A at the same commit as it had been and pushed it to GitLab hoping the MR was hanging out and would get reassociated.


      Clearly our mental model of GitLab is wrong. It seems that a post-commit hook or something deletes MRs as a branch is deleted. My question now is: can I get the deleted MR and its discussion back?










      share|improve this question
















      While doing some branch maintenance today, I lost a MR and the associated discussion. Not a tragedy but I'd like to get it back if possible. I found an open GitLab enhancement request to undo branch delete but that doesn't quite seem to be what I want. Here's what happened:



      Branch A was pushed to our local installation of GitLab, an MR created, and some discussion ensued. We realized that A was a good start but we needed some significant refactoring. We hoped to keep the branch name for the work we'd ultimately merge/ship so we:




      • Created A-prime on the local system and pushed it to GitLab

      • Deleted A, hoping that the MR would be associated with the commits, not the branch. But when we deleted A, the MR was no longer accessible.

      • Recreated A at the same commit as it had been and pushed it to GitLab hoping the MR was hanging out and would get reassociated.


      Clearly our mental model of GitLab is wrong. It seems that a post-commit hook or something deletes MRs as a branch is deleted. My question now is: can I get the deleted MR and its discussion back?







      gitlab






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 '18 at 13:20







      Chris Nelson

















      asked Nov 20 '18 at 22:06









      Chris NelsonChris Nelson

      1,45242539




      1,45242539
























          2 Answers
          2






          active

          oldest

          votes


















          1














          I apologize for wasting the communities time. I'm a GitLab newbie and was stumbling around. I didn't stumble far enough. Today we discovered that you can get to the original MR if you have the URL. When you get there, it's Closed, as you'd expect, I suppose. If you go back to the project level and navigate to MRs, then pick the Closed tab, it's there. It likely was there all along but in our panic and newbiness, we didn't find it.






          share|improve this answer
























          • Well spotted, +1.

            – VonC
            Nov 21 '18 at 14:06



















          0















          Deleted A, hoping that the MR would be associated with the commits, not the branch.




          That is not indeed how a MR is managed.



          I prefer creating a new MR, with as a first comment a link to the previous one, and a summary of the state of the discussion.



          However, it does not seem to be possible to rename the branch associated with the MR (issue 32952): this is part of a larger discussion at GitLab, still in progress.



          In the meantime, try and contact GitLab support to ask them to restore your old branch (and hopefully its MR)






          share|improve this answer
























          • Thanks. I'm new to GitLab and no doubt made an error. OTOH, you'd hope GitLab would follow Git precedent of soft deletes. If I git rm a file, I can check it back out. If I git branch -D a branch, I can recreate it until the "database" has been cleaned up. In any case, we run GitLab locally so I need to know a file or table to look in to undelete my MR. Asking support won't help. I'll edit the question to make that clear.

            – Chris Nelson
            Nov 21 '18 at 13:19











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53402306%2fcan-i-recover-a-gitlab-merge-request-for-a-deleted-branch%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          I apologize for wasting the communities time. I'm a GitLab newbie and was stumbling around. I didn't stumble far enough. Today we discovered that you can get to the original MR if you have the URL. When you get there, it's Closed, as you'd expect, I suppose. If you go back to the project level and navigate to MRs, then pick the Closed tab, it's there. It likely was there all along but in our panic and newbiness, we didn't find it.






          share|improve this answer
























          • Well spotted, +1.

            – VonC
            Nov 21 '18 at 14:06
















          1














          I apologize for wasting the communities time. I'm a GitLab newbie and was stumbling around. I didn't stumble far enough. Today we discovered that you can get to the original MR if you have the URL. When you get there, it's Closed, as you'd expect, I suppose. If you go back to the project level and navigate to MRs, then pick the Closed tab, it's there. It likely was there all along but in our panic and newbiness, we didn't find it.






          share|improve this answer
























          • Well spotted, +1.

            – VonC
            Nov 21 '18 at 14:06














          1












          1








          1







          I apologize for wasting the communities time. I'm a GitLab newbie and was stumbling around. I didn't stumble far enough. Today we discovered that you can get to the original MR if you have the URL. When you get there, it's Closed, as you'd expect, I suppose. If you go back to the project level and navigate to MRs, then pick the Closed tab, it's there. It likely was there all along but in our panic and newbiness, we didn't find it.






          share|improve this answer













          I apologize for wasting the communities time. I'm a GitLab newbie and was stumbling around. I didn't stumble far enough. Today we discovered that you can get to the original MR if you have the URL. When you get there, it's Closed, as you'd expect, I suppose. If you go back to the project level and navigate to MRs, then pick the Closed tab, it's there. It likely was there all along but in our panic and newbiness, we didn't find it.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 21 '18 at 13:36









          Chris NelsonChris Nelson

          1,45242539




          1,45242539













          • Well spotted, +1.

            – VonC
            Nov 21 '18 at 14:06



















          • Well spotted, +1.

            – VonC
            Nov 21 '18 at 14:06

















          Well spotted, +1.

          – VonC
          Nov 21 '18 at 14:06





          Well spotted, +1.

          – VonC
          Nov 21 '18 at 14:06













          0















          Deleted A, hoping that the MR would be associated with the commits, not the branch.




          That is not indeed how a MR is managed.



          I prefer creating a new MR, with as a first comment a link to the previous one, and a summary of the state of the discussion.



          However, it does not seem to be possible to rename the branch associated with the MR (issue 32952): this is part of a larger discussion at GitLab, still in progress.



          In the meantime, try and contact GitLab support to ask them to restore your old branch (and hopefully its MR)






          share|improve this answer
























          • Thanks. I'm new to GitLab and no doubt made an error. OTOH, you'd hope GitLab would follow Git precedent of soft deletes. If I git rm a file, I can check it back out. If I git branch -D a branch, I can recreate it until the "database" has been cleaned up. In any case, we run GitLab locally so I need to know a file or table to look in to undelete my MR. Asking support won't help. I'll edit the question to make that clear.

            – Chris Nelson
            Nov 21 '18 at 13:19
















          0















          Deleted A, hoping that the MR would be associated with the commits, not the branch.




          That is not indeed how a MR is managed.



          I prefer creating a new MR, with as a first comment a link to the previous one, and a summary of the state of the discussion.



          However, it does not seem to be possible to rename the branch associated with the MR (issue 32952): this is part of a larger discussion at GitLab, still in progress.



          In the meantime, try and contact GitLab support to ask them to restore your old branch (and hopefully its MR)






          share|improve this answer
























          • Thanks. I'm new to GitLab and no doubt made an error. OTOH, you'd hope GitLab would follow Git precedent of soft deletes. If I git rm a file, I can check it back out. If I git branch -D a branch, I can recreate it until the "database" has been cleaned up. In any case, we run GitLab locally so I need to know a file or table to look in to undelete my MR. Asking support won't help. I'll edit the question to make that clear.

            – Chris Nelson
            Nov 21 '18 at 13:19














          0












          0








          0








          Deleted A, hoping that the MR would be associated with the commits, not the branch.




          That is not indeed how a MR is managed.



          I prefer creating a new MR, with as a first comment a link to the previous one, and a summary of the state of the discussion.



          However, it does not seem to be possible to rename the branch associated with the MR (issue 32952): this is part of a larger discussion at GitLab, still in progress.



          In the meantime, try and contact GitLab support to ask them to restore your old branch (and hopefully its MR)






          share|improve this answer














          Deleted A, hoping that the MR would be associated with the commits, not the branch.




          That is not indeed how a MR is managed.



          I prefer creating a new MR, with as a first comment a link to the previous one, and a summary of the state of the discussion.



          However, it does not seem to be possible to rename the branch associated with the MR (issue 32952): this is part of a larger discussion at GitLab, still in progress.



          In the meantime, try and contact GitLab support to ask them to restore your old branch (and hopefully its MR)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 21 '18 at 5:59









          VonCVonC

          838k29426513191




          838k29426513191













          • Thanks. I'm new to GitLab and no doubt made an error. OTOH, you'd hope GitLab would follow Git precedent of soft deletes. If I git rm a file, I can check it back out. If I git branch -D a branch, I can recreate it until the "database" has been cleaned up. In any case, we run GitLab locally so I need to know a file or table to look in to undelete my MR. Asking support won't help. I'll edit the question to make that clear.

            – Chris Nelson
            Nov 21 '18 at 13:19



















          • Thanks. I'm new to GitLab and no doubt made an error. OTOH, you'd hope GitLab would follow Git precedent of soft deletes. If I git rm a file, I can check it back out. If I git branch -D a branch, I can recreate it until the "database" has been cleaned up. In any case, we run GitLab locally so I need to know a file or table to look in to undelete my MR. Asking support won't help. I'll edit the question to make that clear.

            – Chris Nelson
            Nov 21 '18 at 13:19

















          Thanks. I'm new to GitLab and no doubt made an error. OTOH, you'd hope GitLab would follow Git precedent of soft deletes. If I git rm a file, I can check it back out. If I git branch -D a branch, I can recreate it until the "database" has been cleaned up. In any case, we run GitLab locally so I need to know a file or table to look in to undelete my MR. Asking support won't help. I'll edit the question to make that clear.

          – Chris Nelson
          Nov 21 '18 at 13:19





          Thanks. I'm new to GitLab and no doubt made an error. OTOH, you'd hope GitLab would follow Git precedent of soft deletes. If I git rm a file, I can check it back out. If I git branch -D a branch, I can recreate it until the "database" has been cleaned up. In any case, we run GitLab locally so I need to know a file or table to look in to undelete my MR. Asking support won't help. I'll edit the question to make that clear.

          – Chris Nelson
          Nov 21 '18 at 13:19


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53402306%2fcan-i-recover-a-gitlab-merge-request-for-a-deleted-branch%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

          How to fix TextFormField cause rebuild widget in Flutter