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

Git: Command to stage all selected files #26764

Closed
abgivant opened this issue May 16, 2017 · 6 comments
Closed

Git: Command to stage all selected files #26764

abgivant opened this issue May 16, 2017 · 6 comments
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality git GIT issues scm General SCM compound issues
Milestone

Comments

@abgivant
Copy link

  • VSCode Version: 1.12.1
  • OS Version: Windows 8.1

I'm not sure if this is a bug or not, but currently I'm not able to stage multiple files at a time using a keyboard shortcut. I am able to do this using the UI (by clicking the "Stage" button on one of the selected files), but not with a configured keyboard shortcut.

For example, in SourceTree I'm used to selecting a few files (by either control- or shift-clicking), then hitting the space bar to stage them. I tried adding the space bar as a shortcut for the "git.stage" command, but this will only commit a single file in the selection, not all selected files.

Steps to Reproduce:

  1. Open VS Code and configure a keyboard shortcut for the "git.stage" command
  2. Open a git project
  3. Make changes to multiple files in the project
  4. Go to the Source Control pane in the explorer
  5. Control-click or shift-click to select multiple files in the "Changes" section, then type the keyboard shortcut configured above

Expected Result: All selected files should be staged and appear in the "Staged Changes" section
Actual Result: Only the top file in the selected set is staged

Related to this, is there a context for keyboard shortcuts that is specific to when the Source Control pane of the explorer is active? I didn't see one listed in the documentation on the site.

@abgivant abgivant changed the title Ability to stage multiple files at once Unable to stage multiple files at once with keyboard shortcut May 16, 2017
@joaomoreno
Copy link
Member

There's a global Git: Stage All command.

image

Its id is git.stageAll. You can assign a keybinding to it.

@abgivant
Copy link
Author

I tried that before, but that will just stage all available changes. I am trying to stage all selected changes.

So if I have made changes to 8 files, but only want to stage 3 of them, I want to be able to select the 3 files in the explorer and use a keyboard shortcut to stage only the selected files.

@joaomoreno
Copy link
Member

This isn't currently supported.

@joaomoreno joaomoreno reopened this May 19, 2017
@joaomoreno joaomoreno changed the title Unable to stage multiple files at once with keyboard shortcut Git: Command to stage all selected files May 19, 2017
@joaomoreno joaomoreno added feature-request Request for new features or functionality git GIT issues scm General SCM compound issues labels May 19, 2017
@joaomoreno joaomoreno added this to the Backlog milestone May 19, 2017
@joaomoreno joaomoreno removed their assignment Jun 19, 2017
@gandalfsaxe
Copy link

@joaomoreno It IS currently supported but there obviously is a bug. It's supported simply by selecting multiple files in Source Control, right clicking and picking "Stage Changes". The problem is that the corresponding command only stages ONE file (always the first chosen) whenever one invokes it via designated keyboard shortcut instead of right clicking. So obviously it's a bug.

Reproduce:

  1. Map command command": "git.stage to any hotkey
  2. Select multiple files with changes in Source Control View
  3. Right click, click "Stage Changes" - all selected files are committed (observe that the keyboard shortcut shows up in the context menu)
  4. Instead try to invoke keyboard shortcut for command": "git.stage - it only stages the first selected file, not whole selection of files.

@joaomoreno
Copy link
Member

@gandalfsaxe Correct. Closing this for the original issue. #24916 is for the keyboard issue.

@joaomoreno joaomoreno added the *duplicate Issue identified as a duplicate of another issue(s) label Sep 14, 2018
@vscodebot
Copy link

vscodebot bot commented Sep 14, 2018

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Sep 14, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality git GIT issues scm General SCM compound issues
Projects
None yet
Development

No branches or pull requests

3 participants