Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Feature for Copy Current Branch Name #1307

merged 2 commits into from Jan 8, 2021


Copy link

@kh0m kh0m commented Jan 5, 2021


Summary of Changes

  • Registers a command to bind a command id under the namespace gitlens.views.branches
  • Adds a command contribution to make it available in the Command Palette
  • Registers an onCommand activationEvent
  • Uses GitService and env to copy the name to clipboard

Background and Motivation

I love using GitLens and it works great when managing multiple repositories and multiple branches. Given the large number of branches in my repos, I would find it extremely convenient to have a command from the Command Palette that copies the name of the currently checked out branch. I do this so many times in a day in order to paste it in trackers and pull requests.

While this can be done using the copy command in the branchesView, it will save having to open that view and scroll through the hundreds of branches to find the one with the checkmark next to it.

Related Issue: #1306


  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

@eamodio eamodio self-requested a review January 5, 2021 23:09
Copy link

@eamodio eamodio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Although we will need to make some changes before this can be merged in. 😄

package.json Outdated Show resolved Hide resolved
src/views/branchesView.ts Outdated Show resolved Hide resolved
Adds @kh0m contribution
@eamodio eamodio merged commit 3345f67 into gitkraken:main Jan 8, 2021
Copy link

eamodio commented Jan 8, 2021

I made some minor changes and merged it. Thank you so much for your contribution!

Thank you!

Copy link
Contributor Author

kh0m commented Jan 8, 2021

Wow! Thank you for accepting the change and for doing it so quickly too! I've verified it on GitLens insiders--it's so cool to see it on there! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants