- Add the compiled bookmarklet to your browser's bookmarks
- Go to a YouTrack issue page
- Click on the bookmarklet
- An alert shows the
git branch
command that has been copied to the clipboard
Compiled bookmarklet:
`javascript:(function()%7B%24name%20%3D%20document.querySelectorAll('%5Bdata-test%3D%22ring-dropdown%20ring-profile%22%5D')%5B0%5D%3Bissueid%20%3D%20location.pathname.split(%22%2F%22).pop()%20%7C%7C%20%22%22%3Bbranch%20%3D%20%22%22%3Bif%20(%24name%20%26%26%20issueid.match(%2F-%5Cd%2B%24%2F))%20%7Binls%20%3D%20(%24name.title%20%7C%7C%20%22%22).split(%2F%5Cs%2B%2F).map(s%20%3D%3E%20s%5B0%5D%20%7C%7C%20%22%22).join(%22%22).toLowerCase()%3Bbranch%20%3D%20inls%20%2B%20%22%2F%22%20%2B%20issueid%3Bconsole.log(%22branch%3A%20%22%20%2B%20branch)%7D%20else%20%7Bconsole.log(%22could%20not%20create%20branch%20name%22)%7Dif%20(branch)%20%7Bvar%20cb%20%3D%20document.createElement('TEXTAREA')%3Bvar%20cmd%20%3D%20%22git%20checkout%20-b%20%22%20%2B%20branch%3Bcb.value%20%3D%20cmd%3Bdocument.body.app