Using Private GitHub Repositories on JuliaHub
Authentication Setup
In order to securely communicate between JuliaHub and GitHub, every user must create their GitHub Personal Access Token for use within their JuliaHub user account.
Generate GitHub Personal Access Token
This step needs to be done for a new or expired Personal Access Token (PAT) provided the user stores the generated PAT value for JuliaHub Platform session reuse.
- Navigate to GitHub in the web browser and log into your GitHub account
- In the top-right corner of the page, click the user icon to open the profile menu and select Settings. On the left side of the Profile view, scroll to the bottom and select Developer settings:
- In the Developer Settings view, navigate to Personal access tokens to generate a new token.
- For Classic scopes, enable repo (all boxes), admin:org (read:org box only), admin:repo_hook (all boxes)
- For fine-grained Repository permissions, set Content Access to Read and Write
- Make sure you copy and save your generated token for reuse
- The fine-grained PAT is organization specific, so ensure your PAT has permissions for the correct organization. If applicable, your organization administration will need to approve the token before it can be used.
Application Session Authentication
This step will need to be done with each Pumas or JuliaIDE application session:
If applicable, log into your JuliaHub Platform URL in your Chrome browser.
If applicable, launch and connect to either the Pumas or Julia IDE application.
One-time Check: Click Manage icon and select Settings. Search GitHub and make sure: Git Protocol is set to https. This change persists with all sessions.
At the Julia command prompt
julia>
, type;
to switch to Shell promptshell>
At
shell>
, typegh auth login
and you will be prompted as follows:- What account do you want to login into? Select GitHub.com
- What is your preferred protocol for Git operations? Select HTTPS
- Authenticate Git with your GitHub credentials? Answer Yes
- How would you like to authenticate GitHub CLI? Select Paste an authentication token
- Paste your authentication token: You will need to paste the generated PAT value saved in the previous section
For successful completion, the following is displayed:
✓ Configured git protocol ✓ Logged in as GitHub-UserName
How to use an existing GitHub Repository
The following steps will guide you setting up a JuliaHub folder for an existing GitHub repository:
- Step 1: If applicable, create a local copy of your GitHub repository on your local machine
- Step 2: If applicable, log into your JuliaHub Platform URL in your Chrome browser. Launch & connect to either Pumas or Julia IDE application. Execute Application Session Authentication
- Step 3: To upload, drag and drop the repository folder from your local machine to the CODE folder in the
EXPLORER
pane of the Pumas or Julia IDE application
- Step 4: Click the menu icon and select File > Open Folder…
- Step 5: The Open Folder box displays
/home/jrun/data/
. Navigate to the code folder and select the folder uploaded in Step 3. TheEXPLORER
pane refreshes the selected folder view.
Use the Source Control button to navigate to the SOURCE CONTROL
pane to view status of files within this folder. Use the Explorer button to navigate to the EXPLORER
pane to view contents of this folder.
How to create a new GitHub Repository
If you have a JuliaHub folder that is not under version control, the following steps will help guide you through creating a new GitHub repository for this folder:
- Step 1: If applicable, log into your JuliaHub Platform URL in your Chrome browser. Launch & connect to either Pumas or Julia IDE application. Execute application Session Authentication
- Step 2: Click the menu icon and select File > Open Folder…
- Step 3: The Open Folder box displays
/home/jrun/data/
. Navigate to thecode
folder and select the existing folder you want to bring under version control. TheEXPLORER
pane refreshes to the selected folder view. - Step 4: Navigate to the
SOURCE CONTROL
pane by clicking the source control button on the left side bar - Step 5: Initialize to commit your files and subfolders for the new Repository
- Step 6: Publish to push your files and subfolders to the new Repository on GitHub
Troubleshooting
Prompted for Username
This is an indication the Application Session Authentication section was not executed for the active application session.
Failed to authenticate to git remote
This is an indication that the token has expired or deleted. Check your GitHub account and make sure the Personal Access Token is listed and unexpired.
- If missing, you will need to execute Authentication Setup
- If expired, regenerate the token and execute Application Session Authentication
- Make sure you update your saved token
If the fine-grained PAT is in an organization, it will need to be approved by the organization’s administrator.
How to get Help from JuliaHub Support
JuliaHub fully supports the use of git and thus its support is part of the JuliaHub contract. Please reach out to our JuliaHub ticketing system by sending email to: <support@juliahub.com>.