Reopen Remote Git Branch

I am using git thread for my project and I had to create a hotfix branch. When it was completed, I made a transfer request to merge it into master , and then deleted the branch.

Since then, I realized that it also needs to be combined into develop . However, I deleted the branch from the remote, as well as from my PC. Is there a way to open a window to make a transfer request, to combine it with develop ?

I would like to avoid merging master into develop , as it also includes other changes that I made in the release branches (bumping version numbers, etc.).

Or maybe there is another, better solution? In general, what is the good practice of using a git thread with pull requests?

+6
source share
1 answer

Removing a branch simply removes the shortcut attached to the commit. The end, which used to be the head of the branch, is still present. You just need to return the shortcut.

If you combined hotfix in master and created a merge commit in aabbcc , then you can resurrect hotfix using:

 git branch hotfix aabbcc^2 

^2 is short for "second parent." If you did not create merge commits, simply recreate hotfix using the last of your commits:

 git branch hotfix ddeeff 

Of course, if you know ddeeff even in the case of the merge above, you can use the latter commit directly.

+9
source

Source: https://habr.com/ru/post/973461/


All Articles