| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta name="description" content=""> |
| <meta name="keywords" content=" workspace, runtime, project, projects, git, subversion, version control, clone, pull, push, ssh key, ssh keys, github, oauth, gitlab, bitbucket"> |
| <title>Version Control | Eclipse Che Documentation</title> |
| <link rel="stylesheet" href="css/syntax.css"> |
| |
| <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" crossorigin="anonymous"> |
| <!--<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">--> |
| <link rel="stylesheet" href="css/modern-business.css"> |
| <!-- Latest compiled and minified CSS --> |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> |
| <link rel="stylesheet" href="css/customstyles.css"> |
| <link rel="stylesheet" href="css/boxshadowproperties.css"> |
| <!-- most color styles are extracted out to here --> |
| <link rel="stylesheet" href="css/theme-che.css"> |
| |
| |
| <link rel="stylesheet" href="/css/coderay.css" media="screen" type="text/css"> |
| |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js" crossorigin="anonymous"></script> |
| |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js" crossorigin="anonymous"></script> |
| <script src="js/jquery.navgoco.min.js"></script> |
| |
| |
| <!-- Latest compiled and minified JavaScript --> |
| <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> |
| <!-- Anchor.js --> |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/2.0.0/anchor.min.js" crossorigin="anonymous"></script> |
| <script src="js/toc.js"></script> |
| <script src="js/customscripts.js"></script> |
| |
| <link rel="shortcut icon" href="che/docs/images/favicon.ico"> |
| |
| <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> |
| <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> |
| <!--[if lt IE 9]> |
| <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> |
| <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> |
| <![endif]--> |
| |
| <link rel="alternate" type="application/rss+xml" title="che" href="http://0.0.0.0:4000/feed.xml"> |
| |
| <script> |
| $(document).ready(function() { |
| // Initialize navgoco with default options |
| $("#mysidebar").navgoco({ |
| caretHtml: '', |
| accordion: true, |
| openClass: 'active', // open |
| save: false, // leave false or nav highlighting doesn't work right |
| cookie: { |
| name: 'navgoco', |
| expires: false, |
| path: '/' |
| }, |
| slide: { |
| duration: 400, |
| easing: 'swing' |
| } |
| }); |
| |
| $("#collapseAll").click(function(e) { |
| e.preventDefault(); |
| $("#mysidebar").navgoco('toggle', false); |
| }); |
| |
| $("#expandAll").click(function(e) { |
| e.preventDefault(); |
| $("#mysidebar").navgoco('toggle', true); |
| }); |
| |
| }); |
| |
| </script> |
| <script> |
| $(function () { |
| $('[data-toggle="tooltip"]').tooltip() |
| }) |
| </script> |
| <script> |
| $(document).ready(function() { |
| $("#tg-sb-link").click(function() { |
| $("#tg-sb-sidebar").toggle(); |
| $("#tg-sb-content").toggleClass('col-md-9'); |
| $("#tg-sb-content").toggleClass('col-md-12'); |
| $("#tg-sb-icon").toggleClass('fa-toggle-on'); |
| $("#tg-sb-icon").toggleClass('fa-toggle-off'); |
| }); |
| }); |
| </script> |
| |
| |
| </head> |
| <body> |
| <!-- Navigation --> |
| <nav class="navbar navbar-inverse navbar-static-top"> |
| <div class="container topnavlinks"> |
| <div class="navbar-header"> |
| <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> |
| <span class="sr-only">Toggle navigation</span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| </button> |
| <a class="fa fa-home fa-lg navbar-brand" href="index.html"> <span class="projectTitle"> Eclipse Che Documentation</span></a> |
| </div> |
| <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> |
| <ul class="nav navbar-nav navbar-right"> |
| <!-- toggle sidebar button --> |
| <li><a id="tg-sb-link" href="#"><i id="tg-sb-icon" class="fa fa-toggle-on"></i> Nav</a></li> |
| <!-- entries without drop-downs appear here --> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="https://medium.com/eclipse-che-blog/" target="_blank">Blog</a></li> |
| |
| |
| |
| <li><a href="https://github.com/eclipse/che" target="_blank">Source Code</a></li> |
| |
| |
| |
| <!-- entries with drop-downs appear here --> |
| <!-- conditional logic to control which topnav appears for the audience defined in the configuration file.--> |
| |
| |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Get Support<b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| |
| |
| <li><a href="https://github.com/eclipse/che/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Akind%2Fbug" target="_blank">Known Bugs</a></li> |
| |
| |
| |
| <li><a href="https://github.com/eclipse/che/issues/new" target="_blank">File an Issue</a></li> |
| |
| |
| |
| <li><a href="https://stackoverflow.com/questions/tagged/eclipse-che" target="_blank">Che on StackOverflow</a></li> |
| |
| |
| </ul> |
| </li> |
| |
| |
| <!-- |
| <li> |
| |
| |
| |
| <a class="email" title="Submit feedback" href="#" onclick="javascript:window.location='mailto:?subject= feedback&body=I have some feedback about the Version Control page: ' + window.location.href;"><i class="fa fa-envelope-o"></i> Feedback</a> |
| |
| </li> |
| --> |
| |
| <!--comment out this block if you want to hide search--> |
| <li> |
| <!--start search--> |
| <div id="search-demo-container"> |
| <input type="text" id="search-input" placeholder="search..."> |
| <ul id="results-container"></ul> |
| </div> |
| <script src="js/jekyll-search.js" type="text/javascript"></script> |
| <script type="text/javascript"> |
| SimpleJekyllSearch.init({ |
| searchInput: document.getElementById('search-input'), |
| resultsContainer: document.getElementById('results-container'), |
| dataSource: 'search.json', |
| searchResultTemplate: '<li><a href="{url}" title="Version Control">{title}</a></li>', |
| noResultsText: 'No results found.', |
| limit: 10, |
| fuzzy: true, |
| }) |
| </script> |
| <!--end search--> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- /.container --> |
| </nav> |
| |
| <!-- Page Content --> |
| <div class="container"> |
| <div id="main"> |
| <!-- Content Row --> |
| <div class="row"> |
| |
| |
| <!-- Sidebar Column --> |
| <div class="col-md-3" id="tg-sb-sidebar"> |
| |
| |
| <ul id="mysidebar" class="nav"> |
| <li class="sidebarTitle"> </li> |
| |
| |
| |
| |
| |
| <li> |
| <a href="#">Overview</a> |
| <ul> |
| |
| |
| |
| <li><a href="index.html">Introduction</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="quick-start.html">Getting Started</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="single-multi-user.html">Single and Multi-User Flavors</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="infra-support.html">Supported Infrastructures</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Che on Docker</a> |
| <ul> |
| |
| |
| |
| <li><a href="docker-single-user.html">Docker - Single User</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="docker-multi-user.html">Docker - Multi User</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="docker-config.html">Docker - Configuration</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="docker-cli.html">Docker - CLI Reference</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Che on Kubernetes</a> |
| <ul> |
| |
| |
| |
| <li><a href="kubernetes-single-user.html">Kubernetes - Single User</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="kubernetes-multi-user.html">Kubernetes - Multi User</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="kubernetes-config.html">Kubernetes - Configuration</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="kubernetes-admin-guide.html">Kubernetes - Admin Guide</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Che on OpenShift</a> |
| <ul> |
| |
| |
| |
| <li><a href="openshift-single-user.html">OpenShift - Single User</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="openshift-multi-user.html">OpenShift - Multi User</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="openshift-config.html">OpenShift - Configuration</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="openshift-admin-guide.html">OpenShift - Admin Guide</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">User Management</a> |
| <ul> |
| |
| |
| |
| <li><a href="user-management.html">Authentication and Authorization</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="authentication.html">Security Model</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="permissions.html">Permissions</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="organizations.html">Organizations in UD</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="resource-management.html">Resource Management</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">User Guides</a> |
| <ul> |
| |
| |
| |
| <li><a href="creating-starting-workspaces.html">Creating and starting Workspaces</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="ide-projects.html">Projects</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="editor-code-assistance.html">Editor and Code-Assistance</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="dependency-management.html">Dependency Management</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="commands-ide-macro.html">Commands and IDE Macros</a></li> |
| |
| |
| |
| |
| |
| |
| <li class="active"><a href="version-control.html">Version Control</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="debug.html">Debug</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Workspace Administration</a> |
| <ul> |
| |
| |
| |
| <li><a href="what-are-workspaces.html">Workspace Overview</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="stacks.html">Workspace - Stacks</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="recipes.html">Workspace - Recipes</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="servers.html">Workspace - Servers</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="installers.html">Workspace - Installers</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="volumes.html">Workspace - Volumes Mount</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="env-variables.html">Workspace - Environment Variables</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="projects.html">Workspace - Projects</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="workspaces-troubleshooting.html">Workspace - Troubleshooting</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="workspace-data-model.html">Workspace Data Model</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Portable Workspaces</a> |
| <ul> |
| |
| |
| |
| <li><a href="chedir-getting-started.html">Chedir - Getting Started</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="why-chedir.html">Chedir - Why Chedir?</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="chedir-installation.html">Chedir - Installation</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="chedir-project-setup.html">Chedir - Project Setup</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="chedir-up-and-down.html">Chedir - Up and Down</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="chefile.html">Chedir - Chefile</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="chedir-ssh.html">Chedir - SSH</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="factories-getting-started.html">Factory - Getting Started</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="creating-factories.html">Factory - Creating</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="factories_json_reference.html">Factory - JSON Reference</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Developer Guides</a> |
| <ul> |
| |
| |
| |
| <li><a href="framework-overview.html">Overview</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="rest-api.html">SDK - REST API</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="che-in-che-quickstart.html">SDK - Your First Plugin</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="build-reqs.html">SDK - Building Che</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="assemblies.html">SDK - Assemblies</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="logging.html">SDK - Logging</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="ide-extensions-gwt.html">SDK - GWT IDE Extensions</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="server-side-extensions.html">SDK - Server Side Extensions</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="custom-installers.html">SDK - Installers</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="project-types.html">SDK - Project Types</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="language-servers.html">SDK - Language Support</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="parts.html">IDE UI: Parts</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="actions.html">IDE UI: Actions</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Dev Essentials</a> |
| <ul> |
| |
| |
| |
| <li><a href="guice.html">Dependency Injection</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="dto.html">Transport: DTO</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="json-rpc.html">Communication: JSON-RPC</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="handling-projects-in-plugins.html">Handling Projects in Plugins</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="dao.html">Persistence, DAO</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="properties.html">Properties</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Infrastructure and SPI</a> |
| <ul> |
| |
| |
| |
| <li><a href="spi_overview.html">Overview</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="spi-implementation.html">Implementation Notes</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <!-- if you aren't using the accordion, uncomment this block: |
| <p class="external"> |
| <a href="#" id="collapseAll">Collapse All</a> | <a href="#" id="expandAll">Expand All</a> |
| </p> |
| --> |
| </ul> |
| |
| <!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above. Otherwise, if placed inside customscripts.js, the script runs before the sidebar code runs and the class never gets inserted.--> |
| <script>$("li.active").parents('li').toggleClass("active");</script> |
| |
| </div> |
| |
| |
| |
| |
| <!-- Content Column --> |
| <div class="col-md-9" id="tg-sb-content"> |
| <div class="post-header"> |
| <h1 class="post-title-main">Version Control</h1> |
| </div> |
| |
| |
| |
| <div class="post-content"> |
| |
| |
| |
| |
| |
| <!-- this handles the automatic toc. use ## for subheads to auto-generate the on-page minitoc. if you use html tags, you must supply an ID for the heading element in order for it to appear in the minitoc. --> |
| <script> |
| $( document ).ready(function() { |
| // Handler for .ready() called. |
| $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2' }); |
| /* this offset helps account for the space taken up by the floating toolbar. */ |
| $('#toc').on('click', 'a', function() { |
| var target = $(this.getAttribute('href')) |
| , scroll_target = target.offset().top |
| $(window).scrollTop(scroll_target - 10); |
| return false |
| }) |
| |
| }); |
| </script> |
| |
| <div id="toc"></div> |
| |
| |
| |
| |
| <!-- |
| |
| |
| --> |
| |
| <div class="paragraph"> |
| <p>Eclipse Che natively supports Git which is provided by <a href="https://www.eclipse.org/jgit/">JGit library</a>. Versioning functionality is available in the IDE and in the terminal. Note: an <a href="#svn">SVN plugin</a> also exists, but it’s not part of the default Che assembly.</p> |
| </div> |
| <div class="paragraph"> |
| <p>The following sections describe how to connect and authenticate users to a remote git repository. Any operations that involve authentication on the remote repository will need to be done via the IDE interface unless authentication is setup separately for the workspace machine(terminal/commands).</p> |
| </div> |
| <div class="paragraph"> |
| <p>Private repositories will require a secure SSH connection and most developers who plan to push to a repo will clone it via SSH, so an SSH key pair needs to be generated. SSH keys are saved in user preferences, so you need to generate the SSH key only once and it will be used in all workspaces.</p> |
| </div> |
| <div class="paragraph"> |
| <p><strong>Note: HTTPS git URL can only be used to push changes if you enable oAuth authentication as described in <a href="user-management.html#social-login-and-brokering">GitHub oAuth</a></strong>.</p> |
| </div> |
| <div class="sect1"> |
| <h2 id="generateupload-ssh-keys">Generate/Upload SSH Keys</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>SSH keys can be generated at <code>Profile > Preferences > SSH > VCS</code>. Use the <code>Generate Key</code> button and manually save the resulting key to your Git hosting provider account. When prompted to provide the hostname for your repo, make sure it is a bare hostname (no www or http/https) as in the example below. After the key has been generated, you can view and copy it, and save to your repository hosting account.</p> |
| </div> |
| <div class="paragraph"> |
| <p><strong>IMPORTANT!</strong>. Hostname is an actual hostname of a VCS provider. Examples: <code>github.com</code>, <code>bitbucket.org</code>.</p> |
| </div> |
| <div class="paragraph"> |
| <p><strong>Use Existing SSH Keys</strong></p> |
| </div> |
| <div class="paragraph"> |
| <p>You can upload an existing public key instead of creating a new SSH key. When uploading a key add the hostname (using no <strong>www or http/https</strong> - as in the example below). Note that the <code>public key > view</code> button will not be available with this option as the public file should be generated already.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/ssh_keys.gif" alt="ssh keys"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>The following example is specific to GitHub and GitLab but can be used with all git or SVN repository providers that use SSH authentication. Please refer to documentation provided by other providers for additional assistance.</p> |
| </div> |
| <div class="paragraph"> |
| <p><strong>GitHub Example</strong></p> |
| </div> |
| <div class="paragraph"> |
| <p>If you don’t want to setup GitHub oAuth, you can manually upload a key. Add the associated public key to a repository/account using <strong>github.com</strong>, click your user icon(top right) then <code>settings > ssh and gpg keys > new ssh key</code>. Give a title to your liking and paste the public key copied from Che into form.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/ssh_github.png" alt="ssh github"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p><strong>GitLab Example</strong></p> |
| </div> |
| <div class="paragraph"> |
| <p>To add the associated public key to a git repository/account using <strong>gitlab.com</strong> click your user icon(top right) then <code>Profile Settings > SSH Keys</code>. Give a title to your liking and paste the public key copied from Che.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/ssh_gitlab.png" alt="ssh gitlab"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p><strong>BitBucket Example</strong></p> |
| </div> |
| <div class="paragraph"> |
| <p>You can setup ssh to a dedicated BitBucket Server. Each user will still need to setup their own SSH key for authentication to the BitBucket Server which will be similar to GitHub/GitLab SSH examples.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="github-oauth">GitHub oAuth</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>oAuth for Github allows users via the IDE git menu to import projects using SSH "git@", push to repository, and use pull request panel. To enable automatic SSH key upload to GitHub for users, register an application in your GitHub account <strong>Settings > Developer Settings > oAuth Apps</strong> with the callback <code><a href="http://${CHE_HOST}:${CHE_PORT}/api/oauth/callback" class="bare">http://${CHE_HOST}:${CHE_PORT}/api/oauth/callback</a></code>:</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/github_oauth.png" alt="github oauth"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p><strong>SINGLE-USER ONLY!</strong>. See: <a href="user-management.html#social-login-and-brokering">Setup GitHub oAuth for Multi-User Che</a></p> |
| </div> |
| <div class="paragraph"> |
| <p>Set the following to environment variables in the <code>che.env</code> (See: <a href="docker-config.html">Docker Config</a>) or update your Che OpenShift deployment (See: <a href="openshift-config.html">OpenShift Config</a>).</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre>CHE_OAUTH_GITHUB_CLIENTID=your_github_client_id |
| CHE_OAUTH_GITHUB_CLIENTSECRET=your_github_secret |
| CHE_OAUTH_GITHUB_AUTHURI=https://github.com/login/oauth/authorize |
| CHE_OAUTH_GITHUB_TOKENURI=https://github.com/login/oauth/access_token |
| CHE_OAUTH_GITHUB_REDIRECTURIS=http://${CHE_HOST}:${CHE_PORT}/api/oauth/callback</pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Once the oAuth is setup, SSH keys are generated and uploaded automatically to GitHub by a user in workspace IDE <code>Profile > Preferences > SSH > VCS</code> by clicking the 'Octocat' icon. You can connect to your GitHub account and choose repos to clone, rather than manually type (or paste) GitHub project URL.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="gitlab-oauth">GitLab oAuth</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Currently it is not possible for Che to use oAuth integration with GitLab. Although GitLab supports oAuth for clone operations, pushes are not supported. You can track <a href="https://gitlab.com/gitlab-org/gitlab-ce/issues/18106">this GitLab issue</a> in their issue management system.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="built-in-pull-request-panel">Built-In Pull Request Panel</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Within Eclipse Che there is a pull request panel to simplify the creation of pull requests for GitHub, BitBucket or Microsoft VSTS (with git) repositories.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/pr_panel.png" alt="pr panel"> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="committer-name-and-email">Committer Name and Email</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Committer name and email are set in <code>Profile > Preferences > Git > Committer</code>. Once set each commit will include this information.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="git-workspace-clients">Git Workspace Clients</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>After importing repository, you can perform the most common Git operations using interactive menus or as terminal commands. Terminal git commands require its own authentication setup, which means that keys generated in the IDE will work only when Git is used in the IDE menus. Git installed in a terminal is a different git system. You may generate keys in <code>~/.ssh</code> there as well.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/git.gif" alt="git"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>To faster access to the most frequently used git functionality one can use keyboard shortcuts:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>Commit: <code>Alt + C</code></p> |
| </li> |
| <li> |
| <p>Push to remote: <code>Alt + Shift + C</code></p> |
| </li> |
| <li> |
| <p>Pull from remote: <code>Alt + P</code></p> |
| </li> |
| <li> |
| <p>Work with branches: <code>Ctrl + B</code></p> |
| </li> |
| <li> |
| <p>Compare current changes with the latest repository version: <code>Ctrl + Alt + D</code></p> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="git-in-project-tree-and-editor">Git in Project Tree and Editor</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Files in project explorer and editor tabs can be colored according to their Git Status:</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/project-explorer-editor-tabs-git-colors.png" alt="project explorer editor tabs git colors"> |
| </div> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>Green: new files that are staged in index.</p> |
| </li> |
| <li> |
| <p>Blue: files that contain changes.</p> |
| </li> |
| <li> |
| <p>Yellow: files that are not staged in index.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>Editor displays change markers according to file edits:</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/editor-git-change-markers.png" alt="editor git change markers"> |
| </div> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>Yellow marker: modified line(s).</p> |
| </li> |
| <li> |
| <p>Green marker: new line(s).</p> |
| </li> |
| <li> |
| <p>White triangle: removed line(s).</p> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="git-operations">Git Operations</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p><strong>Commit</strong></p> |
| </div> |
| <div class="paragraph"> |
| <p>Commit your changes at <code>Git</code> → <code>Commit…​</code> main menu or call it with <code>Alt + C</code> shortcut.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/git-commit-tree-view.png" alt="git commit tree view"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>You can select files which will be added to index and committed. All files in the selected package / folder in the project explorer will be checked by default. After selecting files, type commit message. Optionally you could select <code>Amend previous commit</code> to replace previous commit (for more details <a href="https://git-scm.com/docs/git-commit#git-commit---amend">see git docs</a>).</p> |
| </div> |
| <div class="paragraph"> |
| <p>Push your commit to a remote repository by checking <code>Push committed changes to</code> check-box and selecting a remote branch.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Click <code>Commit</code> to proceed (the <code>Commit</code> button is active as long as at least 1 file is selected and a commit message is present or <code>Amend previous commit</code> is checked).</p> |
| </div> |
| <div class="paragraph"> |
| <p>Behavior for files in the list view is the same as in compare window (see <a href="#compare">Reviewing changed files</a> section). Double clicking a file will open diff window with it.</p> |
| </div> |
| <div class="paragraph"> |
| <p><strong>Push/Pull</strong></p> |
| </div> |
| <div class="paragraph"> |
| <p>Push your commits at <code>Git</code> → <code>Remotes…​</code> → <code>Push</code> from main menu or <code>Alt + Shift + c</code> shortcut.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/git-push.png" alt="git push"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Choose a remote repository, local and remote branch. Optionally, you can force <code>Force push</code>. Get changes from a remote repo at <code>Git</code> → <code>Remotes…​</code> → <code>Pull</code> (<code>Alt + P</code> shortcut).</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/git-pull.png" alt="git pull"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>You can use <code>Rebase instead of merge</code> to keep your local commits on top (for more information <a href="https://git-scm.com/docs/git-pull#git-pull—​r">see git docs</a>).</p> |
| </div> |
| <div class="paragraph"> |
| <p><strong>Branches</strong></p> |
| </div> |
| <div class="paragraph"> |
| <p>Manage your git branches at <code>Git</code> → <code>Branches…​</code> from main menu or <code>Ctrl + b</code> shortcut.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/git-branches-window.png" alt="git branches window"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>You can filter branches view by choosing to see only local or remote branches.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="compare">Compare</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Git compare window is used to show files which was changed. This widget could be invoked from different places for different states, but the most frequently used way is to use <code>Git</code> → <code>Compare</code> → <code><Select-to-what></code> from main menu or use <code>Ctrl + Alt + D</code> shortcut to compare current state of code to the latest local commit. Another way is to select an object in project tree and click <code>Git</code> → <code>Select-to-what</code> from item’s context menu. Note, this widget shows changed files in the selected object in project explorer. To see all changes select project folder. Note, if only one file was changed, diff window will be shown instead of compare window.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/git-compare-tree-view.png" alt="git compare tree view"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>By default, affected files are listed as a tree.</p> |
| </div> |
| <div class="paragraph"> |
| <p><code>Expand all directories</code> and <code>Collapse all directories</code> will help you get a better view. <code>View as list</code> button switches the view of changed files to a list, where each file is shown with its full path. To return to the tree view just click <code>Group by directories</code>.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/git-compare-list-view.png" alt="git compare list view"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>To view diff for a file, select it and click <code>Compare</code> or just double click on a file name.</p> |
| </div> |
| <div class="paragraph"> |
| <p>You can review changes between two states of code. To view the diff, use <code>Git</code>→`Compare`→`<Select-to-what>` from main menu. If more than one file has changed the list of changed files will be opened first. To select a file to compare double-click on it or select a file, then click the <code>Compare</code>. Another way to open diff is to select a file in project explorer and click <code>Git</code> → <code>Select-to-what</code> from context menu or directly from editor’s context menu.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/git/git-diff-widget.png" alt="git diff widget"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Your changes are displayed in the left editor and the file being compared to is on the right. The left editor can be used for editing and fixing your changes.</p> |
| </div> |
| <div class="paragraph"> |
| <p>When you have multiple files to review you have the ability to navigate under all the files that are changed. The number of files that are reviewable is displayed in the title of the wizard. Navigate to the next or previous file with <code>Next</code> and <code>Previous</code> buttons.</p> |
| </div> |
| <div class="paragraph"> |
| <p>For a keyboard navigation between the files you can use: <code>Alt + .</code> for <code>Next</code> and <code>Alt + ,</code> for <code>Previous</code>.</p> |
| </div> |
| <div class="paragraph"> |
| <p>The <code>Refresh</code> button updates difference links between editors.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="svn">SVN</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>SVN plugin isn’t included in the default Che build. You can, however, build your <a href="https://github.com/eclipse/che-plugin-svn">own Che assembly with this plugin</a>.</p> |
| </div> |
| </div> |
| </div> |
| |
| <div class="tags"> |
| |
| </div> |
| |
| <!-- |
| --> |
| |
| </div> |
| |
| <hr class="shaded"/> |
| |
| <footer> |
| <div class="row"> |
| <div class="col-lg-12 footer"> |
| Eclipse Che - Documentation <br/> |
| Site last generated: Sep 13, 2018 <br/> |
| <hr> |
| <a href="http://www.eclipse.org" target="_blank">Eclipse Foundation</a><br/> |
| <a href="http://www.eclipse.org/legal/privacy.php" target="_blank">Privacy Policy</a><br/> |
| <a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">Terms of Use</a><br/> |
| <a href="https://www.eclipse.org/legal/epl-2.0/" target="_blank">Eclipse Public License</a><br/> |
| <a href="http://www.eclipse.org/legal" target="_blank">Legal Resources</a><br/> |
| </div> |
| </div> |
| </footer> |
| |
| |
| |
| |
| <!-- /.row --> |
| </div> |
| <!-- /.container --> |
| </div> |
| <!-- /#main --> |
| </div> |
| |
| </body> |
| |
| </html> |