dahlbyk / posh-git

A PowerShell environment for Git
http://dahlbyk.github.io/posh-git/
MIT License
7.62k stars 802 forks source link

Error when pushing to Bitbucket server #942

Closed ssg47 closed 1 year ago

ssg47 commented 1 year ago

System Details

Issue Description

I am experiencing an error with pushing to an in-house Bitbucket server, even though it appears that the push was successful.

Here is the output after changing README.md and adding, commiting and pushing it to the server:

C:\Users\my-user-id\Documents\WindowsPowerShell\adscripts\UpdateRoleGroupMemberships [main ↑1 +1 ~0 -0 !]> git push origin main
git : To https://bitbucket-server.companydomain.com/scm/blah/adscripts.git
At line:1 char:1
+ git push origin main
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (To https://bit-...m/adscripts.git:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

   4d09786..3a1f6ee  main -> main

C:\Users\my-user-id\Documents\WindowsPowerShell\adscripts\UpdateRoleGroupMemberships [main ≡ +1 ~0 -0 !]>

This appears to happen every time.

Since it appears to push the change to the server, I assumed it was an issue with posh-git. To verify, I tried a similar push from a cmd prompt, and got:

C:\Users\my-user-id\Documents\WindowsPowerShell\adscripts\UpdateRoleGroupMemberships>git push origin main
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 556 bytes | 556.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
To https://bitbucket-server.companydomain.com/scm/blah/adscripts.git
   77359eb..c486092  main -> main

C:\Users\my-user-id\Documents\WindowsPowerShell\adscripts\UpdateRoleGroupMemberships>

I am a git novice. (Various server, user and folder names have been changed.)

dahlbyk commented 1 year ago

What host are you using for PowerShell? I've seen this before in PowerShell ISE, which treats Git's status messages as errors because they don't use the primary output stream: image

I'm pretty confident this isn't a posh-git problem, but glad to help you figure this out.

ssg47 commented 1 year ago

You're right, it's ISE. Sorry. Thanks for the response and understanding.