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)
m
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
= Git Status page =
 
= Git Status page =
The <b>Git Status</b> 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.   
+
The <b>Git Status</b> 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.  For help with common Git tasks see [[Orion/Documentation/User_Guide/Tasks/Working_with_Git|Working with Git]].
  
 
[[Image:Orion-status-page-overview.png|Git status page]]
 
[[Image:Orion-status-page-overview.png|Git status page]]
Line 11: Line 11:
  
 
Files with conflicting changes will have additional annotations.
 
Files with conflicting changes will have additional annotations.
 +
 +
== Showing patch ==
 +
 +
You can select files from the unstaged section and click on the <b>Show Patch</b> link in the section header to view the patch on the selected files.
 +
Please note that if you copy the patch contents from the browser and paste it into a patch file, make sure that the patch file has an <b>empty</b> line at the end. This will assure you to apply the patch successfully from either Orion or the git command line.
  
 
== Comparing changes ==
 
== 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 [[Orion/Documentation/User Guide/Reference/Compare page|Compare page]] by clicking the <b>Side by side compare</b> button.  The compare page allows you to merge changes or perform further edits on your uncommitted changes.
+
To view the code diff for a particular change, you can use the twistie icon next at the left of the change to open the diff.  From there, you can traverse the changes using the commands above the diff.   
  
 
[[Image:Orion-status-page-diffs.png|Code diff]]
 
[[Image:Orion-status-page-diffs.png|Code diff]]
 +
 +
To view the diff in the <b>side by side</b> mode, just click on the button.
 +
 +
[[Image:Orion-status-page-diffs-sdiebyside.png|Code diff sidebyside]]
 +
 +
You can also open a separate [[Orion/Documentation/User Guide/Reference/Compare page|Compare page]] by clicking the <b>Compare</b> link. The compare page allows you to merge changes or perform further edits on your uncommitted changes.
 +
 +
You can also use the expand and collapse buttons at the top of the Unstaged and Staged sections to open and close all of the diffs in the list at once.
 +
 +
 +
[[Image:Orion-status-page-expandcollapse.png|Expanding and collapsing diffs]]
  
 
== 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>.  You can stage one file at a time using the stage icon adjacent to the file.
 +
 
 +
[[Image:Orion-status-page-stagesingle-action.png|Stage icon]]
 +
 
 +
You can also stage one or more changes by selecting a group of changes (with Ctrl+Click or Shift+Click) 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]]
  
When the change is staged, the file will be moved to the <b>Staged</b> area.
+
When the changes are staged, the files will be moved to the <b>Staged</b> area.
  
 
[[Image:Orion-status-page-staged-change.png|Staged area]]
 
[[Image:Orion-status-page-staged-change.png|Staged area]]
Line 30: Line 50:
 
== Reverting an unstaged change ==
 
== 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.
+
Suppose you have made a change in your working copy that you want to discard. You can discard a change by selecting one or more files that you wish to revert and performing a checkout of the file contents from your local index.
  
 
[[Image:Orion-status-page-checkout-action.png|Checkout button]]
 
[[Image:Orion-status-page-checkout-action.png|Checkout button]]
Line 37: Line 57:
  
 
[[Image:Orion-status-page-checkout-confirm.png|Confirmation dialog]]
 
[[Image:Orion-status-page-checkout-confirm.png|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 <b>Checkout</b> action to check out all selected changes.
 
 
[[Image:Orion-status-page-checkout_group.png|Checkout selected button]]
 
  
 
== Resetting all changes from the index==
 
== Resetting all changes from the index==
  
You can also reset all the unstaged and staged changes by clicking on the <b>Reset</b> from the page action.
+
You can reset all the unstaged and staged changes by clicking on the <b>Reset</b> button in the main toolbar.
  
 
[[Image:Orion-status-page-reset-action.png|Reset button]]
 
[[Image:Orion-status-page-reset-action.png|Reset button]]
Line 56: Line 70:
 
== Unstaging changes ==
 
== 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 <i>unstaging</i> it. From the top-right corner of the staged area, you can click on the <b>unstage all</b> action to unstage all selected changes or just unstage changes one by one.
+
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 <i>unstaging</i> it. You can either unstage changes one by one with the icon, or select changes and use the <b>Unstage</b> button to unstage a group of changes.
  
 
[[Image:Orion-status-page-unstage-action.png|Unstage button]]
 
[[Image:Orion-status-page-unstage-action.png|Unstage button]]
Line 62: Line 76:
 
== Committing changes ==
 
== Committing changes ==
  
Once changes are staged, you can use actions in the commit area to commit all staged changes. The <b>commit</b> button is disabled if there is no message in the <b>commit message</b>, so you have to input the message before you commit the changes. The <b>Amend</b> check-box is used to amend the last commit.
+
Once changes are staged, you can use the <b>Commit</b> button to commit the changes. You will be prompted for a commit message.  The <b>Amend</b> check-box is used to amend the last commit. Once you've provided a commit message, you can use the <b>Enter</b> key or <b>Submit</b> button to finish the commit. 
  
 
[[Image:Orion-status-page-commit-action.png|Commit area]]
 
[[Image:Orion-status-page-commit-action.png|Commit area]]
  
== Recent commits area ==
+
== Commits area ==
  
There are 2 <b>recent commits</b> 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 <b>fetch, merge and push</b> actions here, which are also available in the [[Orion/Documentation/User Guide/Reference/Git Log page|Log page]]. Clicking on the <b>Complete log</b> navigates to the [[Orion/Documentation/User Guide/Reference/Git Log page|Log page]] with local or remote mode. There you can refer to the details of the commits.  
+
The git status page also shows the recent commits from your local branch. You can manage the local branch using the commands at the top of the area, such as fetch, merge, and push.
  
 
[[Image:Orion-status-page-mini-logs.png|Status page logs]]
 
[[Image:Orion-status-page-mini-logs.png|Status page logs]]
  
=== Fetch from remote branch ===
+
Clicking on the <b>See Full Log</b> navigates to the [[Orion/Documentation/User Guide/Reference/Git Log page|Log page]] for the local branch. There you can refer to the details of the commits, or switch to the remote tracking branch log.
Click on the first action icon <b>Fetch</b> from the <b>remote tracking branch</b> 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 <b>Merge</b> from the <b>remote tracking branch</b> area to merge all the recent commits to the local branch.  
+
 
+
[[Image:Orion-status-page-mini-logs-merged.png|Merged log]]
+
  
=== Push to remote branch ===
+
The typical workflow for committing changes on this page involves reviewing and staging changes, committing them, and then pushing them to the remote tracking branch.  Before pushing changes, it is useful to first click on the <b>Fetch</b> button to fetch all the recent commits, and to <b>Merge</b> them into your local branch.  Once commits from the remote branch are merged, click on the <b>Push</b> button to push all the outgoing commits to the remote tracking branch.
Once commits from remote branch are merged, click on the action icon <b>Push</b> from the <b>local branch</b> area to push all the recent commits to the remote tracking branch. The recent commits on the 2 areas are synchronized as shown below.
+
  
[[Image:Orion-status-page-mini-logs-pushed.png|Push button]]
+
[[Category:Orion]]

Latest revision as of 11:43, 5 July 2017

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. For help with common Git tasks see Working with Git.

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.

Showing patch

You can select files from the unstaged section and click on the Show Patch link in the section header to view the patch on the selected files. Please note that if you copy the patch contents from the browser and paste it into a patch file, make sure that the patch file has an empty line at the end. This will assure you to apply the patch successfully from either Orion or the git command line.

Comparing changes

To view the code diff for a particular change, you can use the twistie icon next at the left of the change to open the diff. From there, you can traverse the changes using the commands above the diff.

Code diff

To view the diff in the side by side mode, just click on the button.

Code diff sidebyside

You can also open a separate Compare page by clicking the Compare link. The compare page allows you to merge changes or perform further edits on your uncommitted changes.

You can also use the expand and collapse buttons at the top of the Unstaged and Staged sections to open and close all of the diffs in the list at once.


Expanding and collapsing diffs

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. You can stage one file at a time using the stage icon adjacent to the file.

Stage icon

You can also stage one or more changes by selecting a group of changes (with Ctrl+Click or Shift+Click) and then clicking the Stage button at the top of the unstaged list.

Stage button

When the changes are staged, the files will be moved to the Staged area.

Staged area

Reverting an unstaged change

Suppose you have made a change in your working copy that you want to discard. You can discard a change by selecting one or more files that you wish to revert and 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

Resetting all changes from the index

You can reset all the unstaged and staged changes by clicking on the Reset button in the main toolbar.

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. You can either unstage changes one by one with the icon, or select changes and use the Unstage button to unstage a group of changes.

Unstage button

Committing changes

Once changes are staged, you can use the Commit button to commit the changes. You will be prompted for a commit message. The Amend check-box is used to amend the last commit. Once you've provided a commit message, you can use the Enter key or Submit button to finish the commit.

Commit area

Commits area

The git status page also shows the recent commits from your local branch. You can manage the local branch using the commands at the top of the area, such as fetch, merge, and push.

Status page logs

Clicking on the See Full Log navigates to the Log page for the local branch. There you can refer to the details of the commits, or switch to the remote tracking branch log.

The typical workflow for committing changes on this page involves reviewing and staging changes, committing them, and then pushing them to the remote tracking branch. Before pushing changes, it is useful to first click on the Fetch button to fetch all the recent commits, and to Merge them into your local branch. Once commits from the remote branch are merged, click on the Push button to push all the outgoing commits to the remote tracking branch.

Back to the top