'How can I push all local commits to the remote except the last one with Visual Studio 2022?

I know how to do this with command line

git push origin HEAD^:master

Question

I am wondering is there a way to do this in VS 2022 user interface. I've tried find similar in the Git Repository window, where Incoming/Outgoing and Local History of commits are listed, by right clicking on a particular Outgoing but find nothing.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source