Search code examples
gitjetbrains-iderider

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.


Solution

  • The staging area is an alternative to changelists that @Jura Gorohovsky has mentioned. For those more comfortable with the concept of staging changes on a file-by-file basis like the Visual Studio experience you described, you basically need to do two things:

    1. Enable Staging Area

    1. Open the Rider IDE settings (File > Settings... or Ctrl+Alt+S)
    2. Search for "stage",
    3. Click to [x] Enable staging area

    enter image description here

    2. Open the Commit Window and Stage Your Files

    1. Open the Commit window (View > Tool Windows > Commit)
    2. On your desired file Right-click > Stage (or individually Unstage)
    3. As you enter a commit message and click Commit, it will commit only the files you've staged

    There's a ton of other more complex maneuvers (see Reference) but that's the basics.

    enter image description here

    Reference: Official Docs for staging area to commit changes