cluster:usage_tips:git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
cluster:usage_tips:git [2022/09/09 14:14] – created lukabcluster:usage_tips:git [2022/10/25 11:15] (current) – [3. Step: Clone the new GitHub project to the cluster] matiasrus
Line 1: Line 1:
-Test+======  Using GitHub for Collaborative Coding on the Cluster ======  
 + 
 +How-to-Guide for connecting your GitHub account to the cluster, creating a new repository, cloning it to the cluster and collaborating on the cluster. 
 + 
 +==== 1. Step: Connect Github Account ==== 
 + 
 +**Connect your Github account to the cluster (more detailed info see: https://docs.gitlab.com/ee/user/ssh.html#add-an-ssh-key-to-your-gitlab-account)** 
 + 
 +//(please skip if you have used GitHub on the cluster before)// 
 + 
 +Create an SSH key on the cluster: 
 + 
 +<code> 
 +ssh-keygen -t ed25519 -C "<youremail@university.com>” 
 +</code> 
 + 
 +Navigate to the folder where it was placed (usually in “/home/user/.ssh/id_ed25519_sk.pub”) and copy the public key (e.g. “ssh-rsa AAAAB3NzaC1...= matiasrus@dunwich.sleep.ru.is”) 
 + 
 +Place the public key on your GitHub account in the browser under //your user > settings > SSH and GPC keys// 
 + 
 +==== 2. Step: Create Repository ==== 
 + 
 +Set up a new GitHub repository on through the Github website (https://github.com) 
 + 
 + 
 +==== 3. Step: Clone the new GitHub project to the cluster ==== 
 + 
 +You can find this shareable link on the start page of the repository using GitHub in the browser. If you are using a private repository, you additionally need to give your fellow users access rights. For this navigate to //settings > collaborators > add people// and add them through their GitHub user names.  
 + 
 +{{:cluster:usage_tips:screenshot_2022-09-09_at_11.15.18.png?400|}} 
 + 
 +<code> 
 +git clone git@github.com:hiluka/cluster_git.git 
 +</code> 
 + 
 +==== 4. Step: Collaborate! ==== 
 + 
 +Before you work on the project:  
 +<code> git pull </code> 
 + 
 +After you created new code files / plots / results:  
 +<code> git add [changed file or * for all files] </code>  
 + 
 +Then save your current state:  
 + 
 +<code> git commit -m “info about my updates” </code> 
 + 
 +Then push your state to the shared repository: 
 + 
 +<code> git push </code> 
 + 
 +If you need further introduction on Git practices see https://docs.gitlab.com/ee/gitlab-basics/start-using-git.html 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
  • cluster/usage_tips/git.1662732864.txt.gz
  • Last modified: 2022/09/09 14:14
  • by lukab