# Git operations: what Talend Studio does behind the scenes

When working on a Git managed project, you can carry out various Git operations on the branches of your projects. The following two tables outline how Talend Studio interacts with GitHub when you carry out Git related operations in the local and remote modes, and gives the equivalent Git commands corresponding to the Talend Studio actions.

* Available in:
* Big Data
* Big Data Platform
* Cloud API Services Platform
* Cloud Big Data
* Cloud Big Data Platform
* Cloud Data Fabric
* Cloud Data Integration
* Cloud Data Management Platform
* Data Fabric
* Data Integration
* Data Management Platform
* Data Services Platform
* ESB
* MDM Platform
* Real-Time Big Data Platform

## Talend Studio actions and equivalent Git commands in the local mode

| User action in Talend Studio | Git commands performed by Talend Studio |
| --- | --- |
| Save or unlock a project item<br><br>Information noteNote:<br><br><ul> <li>For Cloud, it applies only when the manual commit mode is not                                 enabled.</li> <li>For on-premises, it depends on the <span>Commit                                    mode</span> settings in <span>Talend Administration Center</span>.</li> </ul> | <ol> <li>Gets Git                              status.<pre><code><pre><code><code>git status &lt;current-project-name&gt;</code></code></pre></code></pre></li> <li>Adds the modified files into                              index.<pre><code><pre><code><code>git add &lt;file&gt;</code></code></pre></code></pre></li> <li>Commits                              changes.<pre><code><pre><code><code>git commit -m &lt;commit-message&gt;</code></code></pre></code></pre></li> <li>Gets Git                              status.<pre><code><pre><code><code>git status &lt;current-project-name&gt;</code></code></pre></code></pre></li> </ol> |
| Select Push from the pull-down menu | <ol> <li>Gets Git status.<pre><code><pre><code><code>git status</code></code></pre></code></pre></li> <li>Stashes other                              changes.<pre><code><pre><code><code>git stash save -u &lt;internal-name&gt;</code></code></pre></code></pre></li> <li>Performs a pull.<pre><code><pre><code><code>git pull</code></code></pre></code></pre></li> <li>Performs a push.<pre><code><pre><code><code>git push</code></code></pre></code></pre></li> <li>Calls the JGit API to apply the stash.</li> <li>Drops the                              stash.<pre><code><pre><code><code>git stash drop &lt;stash-id&gt;</code></code></pre></code></pre></li> <li>Gets Git status.<pre><code><pre><code><code>git status</code></code></pre></code></pre></li> </ol> |
| Select Pull And Merge Branch from the pull-down<br>menu | <ul> <li>If the local branch name is the same as the remote branch name:<ol> <li>Gets Git status.<div><pre><code><code>git status</code></code></pre></div></li> <li>Stashes other                                    changes.<div><pre><code><code>git stash save -u &lt;internal-name&gt;</code></code></pre></div></li> <li>Performs a pull.<div><pre><code><code>git pull</code></code></pre></div></li> <li>Calls the JGit API to apply the stash.</li> <li>Drops the                                    stash.<div><pre><code><code>git stash drop &lt;stash-id&gt;</code></code></pre></div></li> <li>Gets Git status.<div><pre><code><code>git status</code></code></pre></div></li> <li>Deletes local                                    tags.<div><pre><code><code>git tag -d &lt;tag-name&gt;</code></code></pre></div></li> <li>Fetches tags from the Git                                    server.<div><pre><code><code>git fetch -t -p</code></code></pre></div></li> </ol></li> <li>If the local branch name is different from the remote branch name,                              performs a                              merge.<div><pre><code><code>git merge &lt;selected-branch&gt;</code></code></pre></div></li> </ul> |
| Select New Branch from the pull-down menu | Creates a local branch based on the selected<br>branch.<br><br>```<br>git branch <new-branch-name> <base-branch-name><br>``` |
| Select switch from the pull-down menu | <ol> <li>Gets Git status.<div><pre><code><code>git status</code></code></pre></div></li> <li>Re-logs on to the project on the selected branch.</li> </ol> |
| Select check out as local branch from the<br>pull-down menu | <ul> <li>If the local branch name is the same as the remote branch name,                              creates the local branch based on the selected branch and associates                              the new branch with the base                              branch.<div><pre><code><code>git branch &lt;new-branch-name&gt; &lt;base-branch-name&gt; --track</code></code></pre></div></li> <li>If the local branch name is different from the remote branch name,                              creates the local branch based on the selected                              branch.<div><pre><code><code>git branch &lt;new-branch-name&gt; &lt;base-branch-name&gt;</code></code></pre></div></li> </ul> |
| Select More &gt; Add Tag from the pull-down menu | <ol> <li>Deletes local                              tags.<div><pre><code><code>git tag -d &lt;tag-name&gt;</code></code></pre></div></li> <li>Fetches tags from the Git                              server.<div><pre><code><code>git fetch -t -p</code></code></pre></div></li> <li>Creates the tag.<div><pre><code><code>git tag &lt;tag-name&gt;</code></code></pre></div></li> <li>Deletes local                              tags.<div><pre><code><code>git tag -d &lt;tag-name&gt;</code></code></pre></div></li> <li>Fetches tags from the Git                              server.<div><pre><code><code>git fetch -t -p</code></code></pre></div></li> </ol> |
| Select More &gt; Reset from the pull-down menu | Performs a reset to the current<br>branch.<br><br>```<br>git reset --hard origin/<branch-name><br>``` |

* Available in:
* Big Data
* Big Data Platform
* Data Fabric
* Data Integration
* Data Management Platform
* Data Services Platform
* ESB
* MDM Platform
* Real-Time Big Data Platform

## Talend Studio actions and equivalent Git commands in the remote mode

| User action in Talend Studio | Git commands performed by Talend Studio |
| --- | --- |
| Save or unlock a project item<br><br>Information noteNote: It depends on the Commit<br>mode settings in Talend Administration Center. | <ol> <li>Gets Git                              status.<div><pre><code><code>git status &lt;current-project-name&gt;</code></code></pre></div></li> <li>Adds the modified files into                              index.<div><pre><code><code>git add &lt;file&gt;</code></code></pre></div></li> <li>Commits                              changes.<div><pre><code><code>git commit -m &lt;commit-message&gt;</code></code></pre></div></li> <li>Gets Git                              status.<div><pre><code><code>git status &lt;current-project-name&gt;</code></code></pre></div></li> <li>Stashes other                              changes.<div><pre><code><code>git stash save -u &lt;internal-name&gt;</code></code></pre></div></li> <li>Performs a pull.<div><pre><code><code>git pull</code></code></pre></div></li> <li>Performs a push.<div><pre><code><code>git push</code></code></pre></div></li> <li>Calls the JGit API to apply the stash.</li> <li>Drops the                              stash.<div><pre><code><code>git stash drop &lt;stash-id&gt;</code></code></pre></div></li> <li>Gets Git status.<div><pre><code><code>git status</code></code></pre></div></li> </ol> |
| Select New Branch from the pull-down menu | Creates a local branch based on the selected<br>branch.<br><br>```<br>git branch <new-branch-name> <base-branch-name><br>``` |
| Select switch from the pull-down menu | <ol> <li>Gets Git status.<div><pre><code><code>git status</code></code></pre></div></li> <li>Deletes local                              tags.<div><pre><code><code>git tag -d &lt;tag-name&gt;</code></code></pre></div></li> <li>Fetches tags from the Git                              server.<div><pre><code><code>git fetch -t -p</code></code></pre></div></li> <li>Re-logs on to the project on the selected branch.</li> </ol> |
| Select check out as local branch from the<br>pull-down menu | <ul> <li>If the local branch name is the same as the remote branch name,                              creates the local branch based on the selected branch and associates                              the new branch with the base                              branch.<div><pre><code><code>git branch &lt;new-branch-name&gt; &lt;base-branch-name&gt; --track</code></code></pre></div></li> <li>If the local branch name is different from the remote branch name,                              creates the local branch based on the selected                              branch.<div><pre><code><code>git branch &lt;new-branch-name&gt; &lt;base-branch-name&gt;</code></code></pre></div></li> </ul> |
| Select More &gt; Add Tag from the pull-down menu | <ol> <li>Deletes local                              tags.<div><pre><code><code>git tag -d &lt;tag-name&gt;</code></code></pre></div></li> <li>Fetches tags from the Git                              server.<div><pre><code><code>git fetch -t -p</code></code></pre></div></li> <li>Creates the tag.<div><pre><code><code>git tag &lt;tag-name&gt;</code></code></pre></div></li> <li>Deletes local                              tags.<div><pre><code><code>git tag -d &lt;tag-name&gt;</code></code></pre></div></li> <li>Fetches tags from the Git                              server.<div><pre><code><code>git fetch -t -p</code></code></pre></div></li> </ol> |