Stashing, Resetting and Tagging

This section covers three essential Git actions: stashing, resetting, and tagging.

Stashing – Temporarily Saving Your Changes

The Git stashing feature allows you to save changes in your working tree that you don't want to commit immediately. This is useful when you are in the middle of a task but need to address something urgent. Stashing provides a way to temporarily save your work and retrieve it later, offering a quick alternative to creating a temporary branch.

Stashing Process:

  1. Save Your Changes:

    Stash Changes Command

  2. Add a Description:

    Stash Description

  3. Retrieve Stashed Changes:

    Apply Stashed Changes

    Note: Applying stashed changes does not automatically delete the stash. Use the "Delete Stashed Commit" command when the stash is no longer needed.

For detailed command-line instructions and additional information on stashing, visit Git SCM Stashing Documentation. This section focuses on the Model RealTime user interface actions.

Reset – Reverting Your Changes

The "Reset" command allows you to discard all current changes in your working tree and revert to the last stable version of the history. You can perform a reset from the context menu of a repository in the Git Repositories view.

Variants of Reset:

  1. Soft Reset:

  2. Mixed Reset:

  3. Hard Reset:

    Reset Command

    Use the "Hard Reset" option when you want to completely discard your current changes and revert to the last committed state.

For more details on when to use each variant, see Git SCM Reset Documentation.

Tagging – Marking Important Commits

Tags are labels that you can attach to specific commits, often used to mark significant commits such as releases or other important milestones.

Creating a Tag:

  1. Create a Tag:

    Create Tag Command

  2. Tag Details:

    Tag Details

  3. Viewing Tags:

    Tag in History View

    You can also create a new branch based on a tag from this view.

    Create Branch from Tag