View: Git Status & Staging

Symbol:

Corresponding Git command: git status

Function: The view shows the Git status of the objects and files which have changed or are new since the last commit. Changes can be staged for a commit here and committed. A comparison of the changes is possible directly and changes since the last commit can be removed from the working directory. When conflicts occur from a merge attempt, this is shown in the view here.

Call: Git → Status & Staging menu

Requirement: The open project is managed in Git.

Title bar:

 

Branch: <branch name>

Last commit: <ID>

Name of the affected branch

The current status of the branch is prepended.

Examples: Merging, Unresolved Conflicts

Clicking the name of the branch opens the Git Branches view.

Clicking the ID of the last commit opens the Git History view.

The view is refreshed.

Discard all changes (git reset --hard)

Regardless of a selection in the table, all changes are discarded, even any unstaged changes. The project is reset to the status which it had before all changes were not yet committed.

Commit complete (git commit complete)

Opens the Commit staged and unstaged changes dialog (see below)

Compare the changes:

Double-click an object entry to open a separate Comparison view ("Diff"), which shows the differences between the current status of the object (new...) and the last committed status (base...). For details, see "Comparison view" below.

Find affected objects in the project navigator:

For more information, see the Show this object and Show all affected objects commands in the context menu of an object entry.

Staged Changes

The top part of the Git Status view shows the changed objects which are staged for a commit (Git index). This is where the staging for commits are organized and the commits performed.

Object

Physical path

Path of the changed object in the Git project

Example: project\device\plc_logic\application\plc_prg

When the Show physical paths option in the context menu of the Object column is selected, the Physical path column with the full path of the object is also displayed.

Example: project\device_5aca2685\plc_logic_b738fa32\application_0dcb78bb\plc_prg_33759ca0\33759ca04 b4e4930a972d2050e97661a.object

Context menu of an object entry:

  • Show this object: The object is selected in the project navigator.

  • Show all affected objects: Available at the entry of a conflicted object: All objects for which the conflict has not yet been resolved are selected in the project navigator.

   

Index status, Details

Git status of the object in the index (internal)

Possible statuses:

: Unaltered: The object is identical to the current status in the Git repository.

: New (in the index): The object has recently been added to the index. It does not exist in the Git repository.

: Modified (in the index): The object has been changed from the previous version in the index. In this case, the response can be to commit (git commit) or discard the changes (git reset).

  • The change can be removed from the index (git reset --mixed): Unstage the selected changes (git reset --mixed)

  • The change can be discarded completely: Discard all changes (git reset --hard)

: Deleted: The object has been deleted.

Attention: A reset operation in the index may overwrite the contents of the object in the working directory.

Discard all changes (git reset --hard)

Regardless of a selection in the table, all changes are discarded, even any unstaged changes. The project is reset to the status which it had before all changes were not yet committed.

Commit complete

Opens the Commit staged and unstaged changes dialog

Commit the staged changes (git commit)

Opens the Commit staged changes dialog

On commit, all changes in the index (staged changes) are applied to the new commit. The changes in the working directory (unstaged) are not applied.

Unstage the selected changes (git reset --mixed)

The staged changes for the commit are reset to "unstaged". The entries in the window are removed.

Attention: A reset operation in the index may overwrite the contents of the object in the working directory.

Unstaged Changes

The bottom part of the Git Status view shows all changes which have been made in the project since the last commit and those which are not yet staged for a commit. They can now be staged. These can be changes to objects which are already tracked in the Git repository, or still "untracked" objects. "Untracked" objects have not yet been registered in the Git repository by means of the Add (git add) or Commit (git commit) command.

Object

Physical path

Path of the changed object in the Git project

Example: project\device\plc_logic\application\plc_prg

For the possible display of Physical path, see above in "Staged Changes".

   

Working tree status, Details

Status of the object in the working directory:

  • : Unaltered (in the working directory): The object is unchanged from the index.

  • : New (in the working directory): The object exists in the working directory, but it is not yet in the index or Git repository.

  • : Deleted (in the working directory): The object no longer exists in the working directory, but it is tracked in the Git repository (index). It has already been added once by means of the git add and/or git commit command.

  • : Modified (in the working directory): The object has been changed from the previous version in the index.

  • : A conflict occurred when merging the object. In this case, the context menu includes the following commands to handle the conflict:

    • Resolve manually: A comparison view of the two affected commits opens.

    • Resolve using ours: The status of the newer commit ("New") is applied.

    • Resolve using theirs: The status of the older commit (base) is applied.

    When committing after treating the conflict, the commit message automatically includes a list of the affected objects.

: Stage changes

(git add)

The selected changes are staged for the commit and moved to the Staged Changes area.

: Rollback all unstaged changes

(git clean & git checkout)

All changes which are listed in the Unstaged Changes view are discarded.

: Toggle selection of all changes

The selection of all changes is selected or deselected.