Skip to main content

View: Git Status & Staging

Symbol: _git_icon_status.png

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 or relationship issues 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, _git_icon_status_conflicted.png Unresolved Conflicts or Unresolved Relationship Issues

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

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

_git_icon_refresh.png

The view is refreshed.

_git_icon_reset_hard.png 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.

_git_icon_commit_complete.png 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 an object affected by a conflict or relationship issue: 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:

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

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

_git_icon_status_modified.png: 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): _git_icon_reset_mixed.png Unstage the selected changes (git reset --mixed)

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

_git_icon_status_deleted.png: Deleted: The object has been deleted.

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

_git_icon_reset_hard.png 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.

_git_icon_commit_complete.png Commit complete

Opens the Commit staged and unstaged changes dialog

_git_icon_commit.png 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.

_git_icon_reset_mixed.png 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:

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

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

  • _git_icon_status_deleted.png: 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.

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

  • _git_icon_status_conflicted.png: A conflict or relationship issue 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 state of the newer commit ("New") is applied.

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

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

_git_icon_add.png: Stage changes

(git add)

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

_git_icon_clean.png: Rollback all unstaged changes

(git clean & git checkout)

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

_git_icon_toggle_selection.png: Toggle selection of all changes

The selection of all changes is selected or unselected.

Dialog: Commit staged changes

Symbol: _git_icon_commit_staged.png

Function: In the dialog, you initiate a commit of the staged changes or an empty commit.

Call: Commit complete command in the Git Status view

<user name and email>

Name and email address of the committer These credentials for the repository can be saved in the .gitconfig of the local repository with Remember me. Then CODESYS Git will automatically use them for the next corresponding actions.

Commit to <...>

Destination of the commit. Example: Commit to branch 'refs/heads/master'

<name of the committer>

Name and E-Mail address of the committer

In CODESYS Git, no distinction is made between the committer and the author. Therefore, the author is already specified here as the committer.

Commit message

Commit message (required)

Allow empty commit

standard icon: If there are no changes in the project, an "empty" commit is performed. Empty commits are used as a kind of comment or marker in the history.

Dialog: Commit staged and unstaged changes

Symbol: _git_icon_commit_complete.png

Function: In the dialog, you initiate the commit of all changes in the project, whereby the status "staged" is skipped. As in the Commit staged changes dialog, you need to specify a commit message and, provide or confirm the committer information. Optionally, an empty commit is also possible here.

Call: Commit complete command in the Git Status view

Comparison view

Symbol: icon_compare.png

Function: The view shows the differences between the commits. Changes can be accepted or discarded.

Call: Double-click a change in the Git Status. view

Important

DO NOT make any changes in the comparison view. Only exception: Resolving any conflicts.

The functionality and handling of the comparison view correspond to the comparison view which is used for a project compare.

The new status of the object (new (staged|unstaged) which is created by the change is compared with the last status of the object in the index (base (head, <object ID>) for the unstaged changes. For the staged changes, it is compared with the last status in the repository.

For more information about the CODESYS comparison view, see: Project Comparison