Closed huehnerlady closed 4 weeks ago
I checked the source of "git.stashIncludeUntracked" command and found that there is no option to avoid the message prompt for stashing unfortunately.
If you can use git command in your environment, you may use "Command Runner" extension to do that. Please also refer the section about "Command Runner" in README.md
{
"key": "cmd+alt+ctrl+u",
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
{
"command": "command-runner.run",
"args": { "command": "git stash" }
},
]
}
}
@ryuta46 thanks for the answer. Unfortunately that command does not seem to work for me.
When I use that I see the terminal opening and the command executing and also the output that it was successful, but the actual file did not get stashed. when I use the same terminal and type the same command I get the same output as I get with the shortcut, but the file also gets stashed.
I also tried with interval, but that doesn't seem to work either. Any idea why?
Here is my command
{
"key": "cmd+alt+ctrl+u",
"label": "Multi-command: git stash, pull rebase, stash pop",
"command": "extension.multiCommand.execute",
"interval": 10000,
"args": {
"sequence": [
{
"command": "command-runner.run",
"args": { "command": "git stash --include-untracked" }
},
"git.pullRebase",
"git.stashPopLatest"
]
}
}
Please check the stash command is executed as you expected.
{
"key": "cmd+alt+ctrl+u",
"command": "command-runner.run",
"args": { "command": "git stash" }
}
{
"key": "cmd+alt+ctrl+u",
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
{
"command": "command-runner.run",
"args": { "command": "git stash" }
}
]
}
}
And please don't forget to save the target file before executing any stash try.
{
"key": "cmd+alt+ctrl+u",
"command": "command-runner.run",
"args": { "command": "git stash" }
}
works
{
"key": "cmd+alt+ctrl+u",
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
{
"command": "command-runner.run",
"args": { "command": "git stash" }
}
]
}
}
works
{
"key": "cmd+alt+ctrl+u",
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
{
"command": "command-runner.run",
"args": { "command": "git stash" }
},
"git.pullRebase",
"git.stashPopLatest"
]
}
},
doesn't work :(
any idea what I can do to fix that?
doesn't work :(
Please provide details. What did you expect to happen and what were the results?
This one seems to work now, so I do everything manually with command-runner
{
"key": "cmd+alt+ctrl+u",
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
{
"command": "command-runner.run",
"args": { "command": "git stash" }
},
{
"command": "command-runner.run",
"args": { "command": "git fetch --prune" }
},
{
"command": "command-runner.run",
"args": { "command": "git pull --rebase" }
},
{
"command": "command-runner.run",
"args": { "command": "git stash pop" }
}
]
}
},
doesn't work :(
Please provide details. What did you expect to happen and what were the results?
It did not actually stash the items as expected and so when I did the rebase it said I have uncommitted changes and that I need to stash them
@ryuta46 thanks for the help, for me the issue would be fixed, unless you want to track something?
It's fine. I close this issue.
Hi,
I am trying to implement a multi command where I
my keybinding.json looks like this:
But when I run it I always get the prompt to add a text:
I would like to also automate that. How can I do that?