Issue Type: Feature Request
VS Code version: Code 1.24.1 (24f62626b222e9a8313213fb64b10d741a326288, 2018-06-13T17:51:32.889Z)
OS version: Windows_NT x64 10.0.17134
(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
Yes. This is really helpful in case ammending commits.
This is not such a great idea since it will lead to destructive behaviour.
I suggest to use the command line in these rare cases.
Maybe it could be switched in the settings and be disabled by default.
Sent from Mail for Windows 10
From: João Moreno
Sent: Τετάρτη, 27 Ιουνίου 2018 10:25
To: Microsoft/vscode
Cc: Theodore Tsirpanis; Author
Subject: Re: [Microsoft/vscode] Add support for Git force push within theeditor. (#53045)
This is not such a great idea since it will lead to destructive behaviour.
I suggest to use the command line in these cases.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Wanting to force push is definitely not an edge case. For me its daily routine. Before sending a pull request, I clean up the commits in a branch by rebasing, which leads to the need to force push - probably plenty of times.
Sure I can use the console, but that argument could be used against the implementation of any git feature.
If I want to prohibit force pushes, I protect the given branch on GitHub. I think it should be up to the user to decide if force push is a good idea or not, not enforced by the editor. It's way to useful.
I'd really appreciate an atom like function (hidden behind a setting), where I can optinally git push --force instead of the current pull & push.
For me its daily routine. Before sending a pull request, I clean up the commits in a branch by rebasing, which leads to the need to force push - probably plenty of times.
This is definitely not recommended. You can clean up commits, squash them, rebase them, etc... all these operations are local. Your final push should advance master in the server, not replace it.
Basically: https://dev.to/rkfg/comment/103c
Very this. A simpler rule: just never use git push --force* except you're the one and only working on the branch and you're ready for consequences.
In those cases, I am the only one working on the branch. I am not just ready for the consequences - I intend them. Never mentioned master, this is for feature branches.
We want clean pull requests, that can directly be rebased on master. Force push is inevitable for this.
If VS Code, wants to enforce a very specific git workflow, thats fine. But then maybe it should be put in a mission statement, that Code is not meant to be used in Team specific ways. Why this should be the case for such a highly customisable editor is unclear to me though.
@essenmitsosse Sure, would you like to submit a PR? I suggest to introduce separate commands Push (Force), etc. I also suggest showing a modal confirmation prompt when used (something in the lines of This is dangerous, are you sure you know what you're doing) with three options Yeah, Yeah, never bug me again, Cancel.
@joaomoreno Sure I'll take a look at it.
Or we can do it like GitKraken.
There is only one "Push" button, and if there are problems with the push, it asks the user whether to attempt a pull before a second push attempt, or to do a force push. In this case, it warns the user that a force push is a destructive operation before they confirm it again.
It seems there's no UI feedback at the moment when a push fails because it's behind the remote. Would that be a separate issue or part of this?
I would consider it part of this. It does error on that push, right? And what are the alternative actions other than a force push?
Sent from Mail for Windows 10
From: mcintyre94
Sent: Πέμπτη, 28 Ιουνίου 2018 12:13
To: Microsoft/vscode
Cc: Theodore Tsirpanis; Author
Subject: Re: [Microsoft/vscode] Add support for Git force push within theeditor. (#53045)
It seems there's no UI feedback at the moment when a push fails because it's behind the remote. Would that be a separate issue or part of this?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
I guess the other scenario is where you'd want to git pull first. Ah, if you do "push" then you do get an error, but if you do "push to..." then you don't. I'll report that separately.
I've just submitted #53286 to address this issue. Sorry @essenmitsosse I didn't see your PR before I had already submitted it. Thanks for your work as this is the feature I miss the most in vscode. (Hopefully a nice interactive rebase editor will come next)
Most helpful comment
In those cases, I am the only one working on the branch. I am not just ready for the consequences - I intend them. Never mentioned master, this is for feature branches.
We want clean pull requests, that can directly be rebased on master. Force push is inevitable for this.
If VS Code, wants to enforce a very specific git workflow, thats fine. But then maybe it should be put in a mission statement, that Code is not meant to be used in Team specific ways. Why this should be the case for such a highly customisable editor is unclear to me though.