Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to git stage changes in JetBrains IDE or similar functionality

How to add files to git stage in JetBrains Rider? Is this feature implemented? If it's not implemented then in which window can I look through the staged files which I've staged using some external tool?

[UPD]: The use case is to hold separately files I want to commit and files I don't want to commit at the particular moment. Stash is not the solution because I need all changes to be present. VS has this functionality and it's very convenient. You can stage and unstage any files with a single right mouse button click.

like image 200
Tsagana Nokhaeva Avatar asked Nov 07 '18 11:11

Tsagana Nokhaeva


People also ask

How do I stage changes in Git?

First, you edit your files in the working directory. When you're ready to save a copy of the current state of the project, you stage changes with git add . After you're happy with the staged snapshot, you commit it to the project history with git commit .

How do I see Git staging in IntelliJ?

You can use Find Actions which is ⌘⇧A (macOS), or Ctrl+Shift+A (Windows/Linux) and then search for 'Git Staging' to enable Git Staging instead of IntelliJ IDEA Changelists.

How do I use Jetbrains in Git?

Open the project that you want to put under Git. Press Alt+` to open the VCS Operations Popup and select Enable Version Control Integration. Alternatively, from the main menu, select VCS | Enable Version Control Integration. Choose Git as the version control system and click OK.


1 Answers

To separate files that you want to commit/push later, you can use changelists.

  1. Select View | Tool Windows | Version Control (or press Alt+9) to open the Version Control tool window.
  2. In the Local Changes tab of the tool window, select one or multiple items.
  3. Right-click and select Move to Another Changelist..., or press Alt+Shift+M, to move selected items to an existing or a new changelist. Select Set active if you want all new modifications to be auto-added to the new/target checklist.

The above is applicable to Rider and all other IntelliJ Platform-based IDEs (IntelliJ IDEA, WebStorm, PyCharm, PhpStorm etc.), as well as to all version control systems that they support (Git, Mercurial, Subversion, Perforce out of the box; other VCS via plugins).

Move to Another Changelist command in JetBrains Rider

Source: Official Rider docs

like image 86
Jura Gorohovsky Avatar answered Nov 15 '22 20:11

Jura Gorohovsky