DZone
Integration Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Integration Zone > Integrating GitHub Enterprise With SSH and Tokens

Integrating GitHub Enterprise With SSH and Tokens

Working on a project? Here is a quick way to integrate GitHub Enterprise to it via SSH and tokens.

Akhilesh Tripathi user avatar by
Akhilesh Tripathi
·
Jul. 19, 16 · Integration Zone · Tutorial
Like (4)
Save
Tweet
12.07K Views

Join the DZone community and get the full member experience.

Join For Free

Quick Start Guide

Log into GitHub.yourOrganisation.com enterprise and request getting access to the organization.

Fork the GitHub yourOrganisation-API Repository to your GitHub Account.

SSH

Checking for existing SSH keys Lists the files in your .SSH directory, if they exist.

akhilesh@AKHILESHPC MINGW64 /
$ ls -al ~/.ssh
ls: cannot access '/c/Users/akhilesh/.ssh': No such file or directory

Generating a new SSH key and adding it to the ssh-agent

akhilesh@AKHILESHPC MINGW64 /

$ ssh-keygen -t rsa -b 4096 -C "akhilesh@yourOrganisation.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/akhilesh/.ssh/id_rsa):
Created directory '/c/Users/akhilesh/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/akhilesh/.ssh/id_rsa.
Your public key has been saved in /c/Users/akhilesh/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:GENERATED RSA XXXXXXXXX20@yourOrganisation.com
The key's randomart image is:
+---[RSA 4096]----+
| .   ==          |
|. o +.+.         |
|.o * * +.        |
| .+ + *.o..      |
|.+   . oSo .     |
|+ O    B..o      |
|.B =  =.+.       |
|. + .+o.E        |
|   oo..o         |
+----[SHA256]-----+


Adding your SSH key to the SSH-agent:

akhilesh@AKHILESHPC MINGW64 /
$ eval "$(ssh-agent -s)"

Agent pid 10140
akhilesh@AKHILESHPC MINGW64 /
$


To add a new SSH key to your GitHub account, copy the SSH key to your clipboard.

$ clip < ~/.ssh/id_rsa.pub


Go to: https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/  and follow the steps to add SSH to your GitHub account.

Creating an access token

Go to https://GitHub.yourOrganisation.com/settings/tokens. Follow the step given at: https://help.GitHub.com/articles/creating-an-access-token-for-command-line-use/ That token now effectively becomes your password when asked.

Clone GitHub source code

akhilesh@AKHILESHPC MINGW64 /d/yourproject-api09Jun
$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
# exp : git clone https://GitHub.yourOrganisation.com/akhilesh/yourproject-api.git
Cloning into 'yourproject-api'...
Username for 'https://GitHub.yourOrganisation.com': akhilesh
#Promt window for Password : PASTE YOUR TOKEN HERE
remote: Counting objects: 3824, done.
remote: Compressing objects: 100% (1889/1889), done.
remote: Total 3824 (delta 1899), reused 3824 (delta 1899), pack-reused 0
Receiving objects: 100% (3824/3824), 4.19 MiB | 193.00 KiB/s, done.
Resolving deltas: 100% (1899/1899), done.
Checking connectivity... done.
Checking out files: 100% (7164/7164), done.  


Checking out the specific branch

Clone creates the master branch. However, you will have to tell it the specific branch that you want to check out.

akhilesh@AKHILESHPC MINGW64 /d/yourproject-akhilesh
$ cd yourproject
akhilesh@AKHILESHPC MINGW64 /d/yourproject-akhilesh/your project (master)
$ git checkout sprint7
Branch sprint7 set up to track remote branch sprint7 from origin.
Switched to a new branch 'sprint7'
akhilesh@AKHILESHPC MINGW64 /d/yourproject-akhilesh/your project  (sprint7)

$


Pushing to a remote

Use git push to push commits made on your local branch to a remote repository.

$ git push  <REMOTENAME> <BRANCHNAME>


Fetch

Use git fetch to retrieve new work done by other people.

$ git fetch remotename


Merge

Merging combines your local changes with changes made by others.

$ git merge remotename/branchname


Pull

Git pull is a convenient shortcut for completing both git fetch and git merge in the same command:

$ git pull remotename branchname


For more details go to https://help.github.com/

GitHub Git

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Optional in Java: When Better Code Is Not an Alternative
  • 7 Great Terminal/CLI Tools Not Everyone Knows
  • What Are Protocol Buffers?
  • A Brief History of JavaScript

Comments

Integration Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo