Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Orion/Documentation/User Guide/Reference/Git Status page"

(Git Status page)
(Staging changes)
Line 20: Line 20:
 
== Staging changes ==
 
== Staging changes ==
  
Before you can commit a file in Git, it must be added to your local index. This process is called <i>staging</i>, or <i>Git add</i>.  Changes are selected by clicking on one or more (with Ctrl+Click) changes and then clicking the <b>Stage<b> button at the top of the unstaged list.
+
Before you can commit a file in Git, it must be added to your local index. This process is called <i>staging</i>, or <i>Git add</i>.  Changes are selected by clicking on one or more (with Ctrl+Click) changes and then clicking the <b>Stage</b> button at the top of the unstaged list.
  
 
[[Image:Orion-status-page-stage-action.png|Stage button]]
 
[[Image:Orion-status-page-stage-action.png|Stage button]]

Revision as of 11:21, 16 October 2012

Git Status page

The Git Status page provides a summary of the current state of a Git clone associated with your Orion account. This page shows changes in your working tree, staged changes that are ready to commit, and a summary of commits in the active branch.

Git status page

Types of changes

Typically, there are three types of changes: adding, changing and deleting. The types of changes are indicated by icons on the left of the files.

Change type icons

Files with conflicting changes will have additional annotations.

Comparing changes

To view the code diff for a particular change, you can use the twistie icon next at the left of the change. From there, you can traverse the changes using the commands above the diff. You can also open a separate Compare page by clicking the Side by side compare button. The compare page allows you to merge changes or perform further edits on your uncommitted changes.

Code diff

Staging changes

Before you can commit a file in Git, it must be added to your local index. This process is called staging, or Git add. Changes are selected by clicking on one or more (with Ctrl+Click) changes and then clicking the Stage button at the top of the unstaged list.

Stage button

When the change is staged, the file will be moved to the Staged area.

Staged area

Reverting an unstaged change

Let's say you have made a change in your working copy that you want to discard. You can discard a change by performing a checkout of the file contents from your local index.

Checkout button

Clicking on the action pops up the confirmation dialog. Click OK to restore the change from the index or Cancel to cancel the action.

Confirmation dialog

Reverting a group of unstaged changes

You can also discard a group of changes. From the top-right corner of the unstaged area, you can click on the Checkout action to check out all selected changes.

Checkout selected button

Resetting all changes from the index

You can also reset all the unstaged and staged changes by clicking on the Reset from the page action.

Reset button

A confirmation dialog pops up when you click on the action. Click OK to reset the changes from the index or Cancel to cancel the action.

Reset confirmation button

Unstaging changes

If you decide you don't want to commit a change, but want to continue working on it, you can remove it from your index by unstaging it. From the top-right corner of the staged area, you can click on the unstage all action to unstage all selected changes or just unstage changes one by one.

Unstage button

Committing changes

Once changes are staged, you can use actions in the commit area to commit all staged changes. The commit button is disabled if there is no message in the commit message, so you have to input the message before you commit the changes. The Amend check-box is used to amend the last commit.

Commit area

Recent commits area

There are 2 recent commits areas in the git status page. The top one represents the recent commits from the local branch while the bottom one represents the remote tracking branch. Both areas have 5 most recent commits respectively. You can perform fetch, merge and push actions here, which are also available in the Log page. Clicking on the Complete log navigates to the Log page with local or remote mode. There you can refer to the details of the commits.

Status page logs

Fetch from remote branch

Click on the first action icon Fetch from the remote tracking branch area to fetch all the recent commits. All the incoming changes are highlighted as shown above.

Merge from remote branch

Click on the second action icon Merge from the remote tracking branch area to merge all the recent commits to the local branch.

Merged log

Push to remote branch

Once commits from remote branch are merged, click on the action icon Push from the local branch area to push all the recent commits to the remote tracking branch. The recent commits on the 2 areas are synchronized as shown below.

Push button

Back to the top