NDCLab / wiki

comprehensive NDCLab documentation | https://ndclab.github.io/wiki
GNU Affero General Public License v3.0
1 stars 2 forks source link

ghHowTo-collate resources #36

Closed georgebuzzell closed 3 years ago

jessb0t commented 3 years ago

Some starting resources: https://ohmygit.org/ https://lab.github.com/

jessb0t commented 3 years ago

Additional resources: https://docs.google.com/document/d/1H0YCauijjk21wgTx-A-HYUpaNDMdZBlg/edit https://ndclab.github.io/wiki/docs/technical-docs/git_and_github.html https://ndclab.github.io/wiki/docs/technical-docs/pavlovia.html

jessb0t commented 3 years ago

https://lab.github.com/lmachens/git-and-github-first-timers

jessb0t commented 3 years ago

https://github.com/Gazler/githug https://github.com/jlord/git-it-electron#what-to-install

jessb0t commented 3 years ago

@georgebuzzell As part of my resource collation efforts, I'd like to ensure we avoid unnecessary duplication on the wiki since duplication>discrepancy>user confusion.

I have found two existing wiki resources for installing Git:

Questions:

  1. Would it be ok to scrub the installation guidelines from the Pavlovia page (and instead, simply reference the Git and GitHub page), then add to the Git+GitHub page any useful tidbits from the Pavlovia version that are missing there?
  2. I presume that we should use SSH keys for both GitHub and Pavlovia? Please correct me if I'm wrong and we should use a different authentication for GH.
  3. We are not using GitLab, correct? Or is GitLab required for Pavlovia?
georgebuzzell commented 3 years ago

@jessb0t yes, agree that setting up git and ssh keys should be on the getting started with git/github page, then, the pavlovia page says todo those things first and describes how to integrate your existing ssh key with gitlab, how to use gitlab, pavlovia, etc.

jessb0t commented 3 years ago

@georgebuzzell @F-said @Jonhas @SDOsmany @stevenwtolbert

Requesting assistance with instructions for SSH authentication, geared at a non-tech audience. :smile: I understand the main idea of authentication, but I don't understand it well enough to explain to a neophyte. I have found (at least) two GitHub pages devoted to this question, although I'm sure there are others: https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh https://docs.github.com/en/github-ae@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

Can one of you help me:

  1. Boil this information down into a simple step-by-step (no more than five items) that anyone could work through?
  2. Point me to which of these webpages (or another) would serve as the best additional resource to provide to a non-tech user trying to set themselves up with GitHub for the first time?

My aim is to make this all seem very simple/non-scary by walking new lab members through the steps, but doing so without holding their hand so much that they don't learn anything from the experience. I'm including below some examples of other instructions to show what I mean about balancing clarity, simplicity, and empowerment.

Thank you so much!! J


Establish your identity

Set up your identity by typing two commands into your shell: $ git config --global user.name "John Doe" $ git config --global user.email johndoe@example.com (Obviously, replace John Doe and johndoe@example.com with your actual name and your actual e-mail. If you're not sure whether you've done this before, check with the command git config --list.)


Install Git on Mac

  1. Open Terminal.
  2. Install Homebrew by following the instructions on the Homebrew homepage to paste a specific command into your Terminal.
  3. Still inside your Terminal, type: $ brew install git

If you encounter issues, check out the main download page, direct from Git.

georgebuzzell commented 3 years ago

@F-said if you have time to do this, please do, but, you also have several other things you are working on, so, please feel free to ask me to do it by responding and @'ing me!!

jessb0t commented 3 years ago

@georgebuzzell @F-said @Jonhas @SDOsmany @DavyNeat @stevenwtolbert @CamachoBry @yanbin-niu

Hey all! I just wanted to re-ping on my request for help here (and add David, Bryan, and Yanbin to the mix...welcome to the party!). I'm re-pasting the original request below since this issue has a looooong chain of comments (and I don't want to waste your time sorting through them).

Thank you for your guidance! J


Requesting assistance with instructions for SSH authentication, geared at a non-tech audience. 😄 I understand the main idea of authentication, but I don't understand it well enough to explain to a neophyte. I have found (at least) two GitHub pages devoted to this question, although I'm sure there are others: https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh https://docs.github.com/en/github-ae@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

Can one of you help me:

  1. Boil this information down into a simple step-by-step (no more than five items) that anyone could work through?
  2. Point me to which of these webpages (or another) would serve as the best additional resource to provide to a non-tech user trying to set themselves up with GitHub for the first time?

My aim is to make this all seem very simple/non-scary by walking new lab members through the steps, but doing so without holding their hand so much that they don't learn anything from the experience. I'm including below some examples of other instructions to show what I mean about balancing clarity, simplicity, and empowerment.

Thank you so much!! J


Establish your identity

Set up your identity by typing two commands into your shell: $ git config --global user.name "John Doe" $ git config --global user.email johndoe@example.com (Obviously, replace John Doe and johndoe@example.com with your actual name and your actual e-mail. If you're not sure whether you've done this before, check with the command git config --list.)


Install Git on Mac

  1. Open Terminal.
  2. Install Homebrew by following the instructions on the Homebrew homepage to paste a specific command into your Terminal.
  3. Still inside your Terminal, type: $ brew install git
  4. If you encounter issues, check out the main download page, direct from Git.
jessb0t commented 3 years ago

@georgebuzzell @F-said @Jonhas @SDOsmany @DavyNeat @stevenwtolbert @CamachoBry @yanbin-niu

Or are SSH keys even the right way to go? I just did a bit more hunting and it seems like personal access tokens might be a more optimized authentication method? (Full disclosure: I don't understand the technical difference between these options.)

F-said commented 3 years ago

Hey, @jessb0t the following is how to set up git on a lab member's local using both personal access tokens or the SSH key, according to the user's preference.

In my experience, using the SSH key is usually for version control services that do not offer personal access tokens (for example, assembla), or just for anyone that wants that additional security, but correct me if I'm wrong @NDCLab/base-eeg-team

Integrating Git & GitHub

Git is a command-line version-control software that allows users to remotely install and modify lab software and projects. While GitHub is a software tool that utilizes git to host remote repositories which will then be shared across users/organizations/the world.

The following outline describes hooking git with a GitHub account, and using git in the HPC Linux environment:

Outline

GitHub-Integrate

To integrate a GitHub account with Git, a user has the following options (Personal Access Token preferred due to simplicity). The following steps assume that the user has git installed to their machine and a GitHub account created.

Personal-Access-Tokens

A personal access token allows users to use their GitHub account w/o verifying passwords at every instance of cloning, committing, forking, etc. To integrate a GitHub account you must follow the outlined steps as listed in the GitHub documentation

SSH

The following assumes that SSH is installed on your local machine. Windows 10/MacOS/Linux come with SSH. You can validate through:

ssh -v localhost

Which should print the version number and a failed connection.

If this command does not work, download OpenSSH

  1. Generate an SSH Key using the email listed on your GitHub:

    ssh-keygen -t ed25519 -C "your_email@example.com"

Hit enter when prompted:

Enter a file in which to save the key (/c/Users/you/.ssh/id_ed25519):[Press enter]

And enter when prompted to generate a password (no password protection for minimal layers)

Enter passphrase (empty for no passphrase): Enter same passphrase again:

  1. Reveal the SSH key For Unix/MacOS:

    cat ~/.ssh/id_rsa.pub

For Windows, where USERNAME is the user's Windows user name

type C:\Users\USERNAME.ssh\id_rsa.pub

  1. . Copy the outputted key to your Clipboard, then paste it to your GitHub account settings:

    Untitled
  2. Test your SSH connection

    ssh -T -p 443 git@ssh.github.com You should see: Hi [username]! You've successfully authenticated, but GitHub does not provide shell access.

  3. By ssh'ing into GitHub, it should be listed as a known_host within your .ssh file. Check through: For Unix/MacOS:

    cat ~/.ssh/known_hosts

For Windows, where USERNAME is the user's Windows user name

type C:\Users\USERNAME.ssh\known_hosts

Git-On-HPC

Git on the HPC login node should only be used for project downloading & data analysis (through Slurm scripts), while development should occur on a personal machine.

Without associating a user account on the HPC, repositories could be cloned in "read-only" mode which is preferable given development should not be happening on the cluster.

However, a GitHub account (and subsequent write priveledges) could be associated by attaching the user name and password while on the cluster:

  1. Attach user name, where "GitHub user name" is your user name

    git config --global user.name "GitHub user name"

  2. Attach email, where "your_email@example.com" is your GitHub associated email

    git config --global user.email "your_email@example.com"

  3. Set up personal access token or SSH key on HPC cluster (TO BE EDITED)

jessb0t commented 3 years ago

Closed with #56.