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

Bring back Get-GitBranch #935

Closed
Pxtl opened this issue Dec 8, 2022 · 2 comments
Closed

Bring back Get-GitBranch #935

Pxtl opened this issue Dec 8, 2022 · 2 comments

Comments

@Pxtl
Copy link

Pxtl commented Dec 8, 2022

System Details

  • posh-git version/path: 1.1.0
  • PowerShell version: 5.1.19041.1682
  • Git version: 2.38.1.windows.1
  • OS: Microsoft Windows NT 10.0.19044.0

Issue Description

The commandlet Get-GitBranch has been removed from the Posh-Git exported commands list. It's still present in the repo utils but has been left out of the export script. Get-GitBranch is very useful to my workflow -- every time I push a new branch, I do

git push -u origin (Get-GitBranch)

Can this be resurrected? Otherwise is there a powershell module I should be using instead?

@hmleal
Copy link

hmleal commented Dec 13, 2022

In the mean time you can use something like this: git push -u origin (git rev-parse --abbrev-ref HEAD)

@dahlbyk
Copy link
Owner

dahlbyk commented Dec 13, 2022

every time I push a new branch, I do

git push -u origin (Get-GitBranch)

In the mean time you can use something like this: git push -u origin (git rev-parse --abbrev-ref HEAD)

Even better: git push -u origin HEAD!

# pnb = push new branch
git config --global alias.pnb "push -u origin HEAD"

Removing Get-GitBranch was part of a deliberate effort (#427) to reduce posh-git's surface area to tab expansion + prompt. You could use If you want PowerShell functions for Git, check out https://github.com/PoshCode/PSGit.

@dahlbyk dahlbyk closed this as completed Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants