# The Source Control Panel

> The **Source Control** panel provides a complete Git workflow inside Studio. The panel is available whenever a project that belongs to a Git repository is open. It is docked to the left of the designer together with other panels (**Explorer**, **Activities**, **Snippets**, etc.).

The **Source Control** panel provides a complete Git workflow inside Studio. The panel is available whenever a project that belongs to a Git repository is open. It is docked to the left of the designer together with other panels (**Explorer**, **Activities**, **Snippets**, etc.).

The **Source Control** panel works only with Git repositories. Projects managed with TFS and SVN are still managed from the **Team** backstage tab.

The first time you open the panel, you are instructed to initialize a local Git repository. This step is mandatory and is performed automatically by selecting the **Initialize Repository** button. 

The panel contains two distinct sections:
1. **Changes**: Lists all files that have been modified, added, deleted, or renamed in the working tree and hosts the commit controls.
2. **Graph**: Renders the repository's commit history as an interactive visual graph.

Clicking each section header collapses or expands the corresponding section. When a section is collapsed, its header displays the number of items it contains, allowing you to monitor activity at a glance.

## The Changes section

The **Changes** section lists all pending file changes, separated into staged and unstaged groups. 

Each file entry features a color-coded status letter (**M** – modified, **A** – added, **D** – deleted, **R** – renamed, **U** – untracked).

Hover over or right-click a file to access file-specific options:
* **Open File**, to open the file in the **Designer** panel.
* **Discard Changes**, to revert the file to its last committed state.
* **Stage** or **Unstage**.
* **Add to .gitignore**, to exclude the file from future tracking.
* **Reveal in File Explorer**, to open the file's location on your machine.
* **Reveal in Explorer View**, to open the Explorer panel.

Use the **Message** field to write your commit message. After writing your message, select **Commit** or use the CTRL + Enter keyboard shortcut. If no files are explicitly staged when you commit, all changes are staged automatically.

Select the arrow next to the **Commit** button to access more options:
* **Commit**: Commits staged changes locally. 
* **Commit (Amend)**: Adds staged changes to the most recent commit.  
* **Commit and Push**: Commits then pushes to the remote branch. 
* **Commit and Sync**: Commits staged changes, then pulls and pushes to sync with the remote branch.

Select the **Refresh** button at the top of the **Changes** section to reload the section. 

You can also select the **More options** button to:
* Access the **Pull**, **Push**, and **Fetch all remotes** operations.
* **Stage all** changes.
* Open the **Manage Branches** window.

An ahead/behind badge next to the branch name in the toolbar shows the number of commits your local branch is ahead of and behind the remote tracking branch.

## The Graph section

The **Graph** section renders your repository's commit history as a visual, multi-lane graph. The section displays up to 200 commits, with branch and tag labels, color-coded branch lines, and Bezier curves to illustrate merge connections. 

Select the branch filter button to switch between which commits to display:
* **Auto**: commits on the current branch.
* **All**: commits across all branches.
* Commits only on a specific branch.

Separate buttons allow you to access functions such as:
* **Fetch all remotes**: Downloads remote changes without merging them.
* **Pull**: Downloads and merges remote changes into the current branch.
* **Push**: Uploads committed local changes to the remote branch.

You can also **Refresh** the section from the dedicated button.

Each row in the **Graph** section represents one commit. Hovering over a commit shows you the commit author, date, message, and abbreviated SHA. You can also copy the full SHA to the clipboard.

Files that have been changed are listed under the **Changed files** list. Right-click a file to from the list and select **Compare with Previous Commit** to open a diff view in the designer.

Right-clicking a commit gives you access to the following options:
* **Checkout Commit**: Checks out the repository at the selected commit.
* **Checkout Branch**: Switches to the branch associated with the selected commit.
* **Cherry-Pick Commit**: Applies the commit's changes to the current branch.  
* **Revert Commit**: Creates a new commit that undoes the changes introduced by the selected commit.
* **Reset Soft**: Moves the branch pointer to the selected commit, keeping all subsequent changes staged.
* **Reset Hard**: Moves the branch pointer to the selected commit and discards all subsequent changes.
* **Compare with Working Tree**: Opens a diff between the commit and your current local files.
* **Compare with Previous Commit**: Opens a diff between the commit and its parent commit.  
* **Copy Commit SHA**: Copies the full commit SHA to the clipboard.

Clicking a file anywhere in the **Source Control** panel (in the **Changes** area or in an expanded commit row in the **Graph** area) opens the diff view.

![The Source Control Panel](https://dev-assets.cms.uipath.com/assets/images/studio/SourceControlPanelStudio-eb196498.webp)
