HPC Lab
  • Home
  • HPC Launch
  • HPC Pipes
  • Workshop
  1. HPC Launch
  2. Day 1
  3. Git and Github
  • HPC Launch
    • Welcome to the HPC-Launch workshop
    • Day 1
      • HPC setup
      • HPC file transfers
      • Git and Github
      • Project structure
    • Day 2
      • Package managers
      • Queueing systems
      • Archiving
      • Knowledge Checks
  • HPC Pipes
    • Welcome to the HPC-Pipes workshop
    • Day 1
      • Day 1 - Part 1
      • Day 1 - Part 2
    • Day 2
      • Day 2 - Part 3
      • Day 2 - Part 4
      • Day 2 - Part 5
  • UCloud setup
    • UCloud project workspace
    • SSH on UCloud
    • GitHub on UCloud
    • Conda on UCloud

On this page

  • Connecting GitHub with UCloud
  1. HPC Launch
  2. Day 1
  3. Git and Github

Git and Github

Published

May 15, 2026

Connecting GitHub with UCloud

Create a new GitHub account if you don’t have one yet. Then, go to repositories and create a new one (e.g. HPCIntro). Finally, create a token classic (for general use).

How? Go to your profile and on the right-side menu select:

Settings > Developer settings (at the bottom) > Personal access tokens > Tokens (classic) > Generate new token (classic).

  • Note: git commit UCloud
  • Select scope: ✅ repo (top option)
  • Do not set a expiration date

Please, remember to save the generated token somewhere locally and safe. You won’t be able to see/copy it again.

Use the token as your password when performing Git operations like push or commit from the HPC.

Then, we will generate SSH key on UCloud following these steps

  1. Submit a new job using the Terminal app and mount your personal drive
  2. Change directory to your personal drive (e.g. cd /work/myNameXXX/)
  3. Create a new folder named ssh, where you will store your new SSH keys
  4. Generate a new key (no need for paraphrase) and save it as e.g. id_repo1
ssh-keygen -t ed25519
  1. Copy the public key (e.g. id_repo1.pub)
  2. Add the key to the repository you have created or forked from us on GitHub: YOUR-REPO > Settings > Deploy keys > Add deploy key. The new deploy key can be named as e.g. UCloud-repo1

Finally, to streamline pushing changes…

  1. Create a new initialization bash script or modify an existing one to include this code. Here, we named the file setup.sh:
setup.sh
eval `ssh-agent -s`
ssh-add /work/ssh/id_repo1
git config --global user.name "add here your name"
git config --global user.email "add here your email"
bash -i 

Remember to save this file in your personal drive (/work/myNameXXX/hpcLaunch). Once you have saved the file, click on stop the aplication.

You are now ready to git commit and push using the token as password and save all changes to your repository. Let’s give it a try!

Submit a new job on UCloud (e.g. through the Terminal app). Do not forget to mount your personal drive (hpcLaunch folder) and use the initialization bash script you just created (setup.sh). Once, the job is running, change directory to your personal drive, and clone the repository you created.

Example repo
git clone <https://github.com/hds-sandbox/cookiecutter-template>

Now, create a new files in your repository. This is a test to understand how to push changes to GitHub.

cd <REPO>
touch file1.txt

git add . 
git commit -m "added new file"
git push 

You will be asked to enter your GitHub username and the password. When you work from HPCs, you need to enter the token as your password.

Go to GitHub and check if those changes are now visible.

Copyright

CC-BY-SA 4.0 license