Setting up a New Research Project in GitHub

If you haven’t set up Git and GitHub yet, complete the Git & GitHub Setup tutorial first.

If you have done this, you already know why we use Git and GitHub. Now let’s walk through exactly how to start using them for your project.

Starting a New Project (Best if you’re starting fresh)

  1. Create the repository on GitHub

    1. Go to the WWS GitHub organization.

    2. Click the green New repository button (top right).

    3. Name your repo using the format:

      WWS-Node#-ProjectCode-ProjectKeywords where:

      • # is the node number
      • ProjectCode is a short (<5 letter) acronym for the project
      • ProjectKeywords describe what the project is about in a few words
    4. Add a brief description (what the project is about).

    5. Choose Public or Private. (Private = only visible within WWS organization.)

    6. Check “Initialize with a README.” This will be your repo’s welcome page with links, notes, and contact info.

    7. (Optional) Add a .gitignore or license — skip if unsure (you can add later).

    8. Click the green Create repository button.

  2. Clone the repo to your computer

    • In GitHub Desktop: File → Clone repository (CTRL + SHIFT + O)

    • Choose your repo from the list.

    • Choose where to save it locally. It’s highly recommended to save your repo on your local (C) drive.

  3. Check your local folder

    • Go to the location you chose. You should see a folder that looks like this:

  4. If using R, make it an R Project

    • Why: R Projects make your data/code portable and keep file paths consistent across computers.

    • In RStudio, run:

    #install.package("usethis") #only need to run the first time 
    library(usethis)
    
    #the location you of your project folder
    local_dir <- "Z:/1_Research/7_WWS/WWS-Node1-MCDOM"
    
    #create a project from the directory
    usethis::create_project(local_dir)

Store all project files here

  • From now on, keep everything in this folder to take advantage of GitHub’s version control and collaboration.

Adding an Existing Project to GitHub

If your project already exists locally and you want to start tracking it in GitHub:

  1. (Optional but recommended) Make it an R Project

    #install.package("usethis") #only need to run the first time 
    library(usethis)
    
    #the location you of your project folder
    local_dir <- "file path to project folder"
    
    #create a project from the directory
    usethis::create_project(local_dir)
  2. Initialize Git in the project

    usethis::use_git()
  3. Add to GitHub Desktop

    • In GitHub Desktop: File → Add local repository (CTRL + O)

    • Select your project folder and click Add Repository.

    • You’ll now see your files listed in GitHub Desktop.

  4. Publish the repo to GitHub

    • In GitHub Desktop, click Publish repository (top right).

    • Name your repo using the format:

      WWS-Node#-ProjectCode-ProjectKeywords where:

      • # is the node number
      • ProjectCode is a short (<5 letter) acronym for the project
      • ProjectKeywords describe what the project is about in a few words
    • Click Publish repository (blue button).

  1. Make your first commit & push

    • In GitHub Desktop, all files will be checked (or staged) by default.

    • Add a commit message (for your first commit, “Initial commit” is common).

    • Click Commit.

    • Click Publish branch (top right) to send your files to GitHub.

  2. Check your repo online

    • Go to GitHub → your repository. You should see all your files there.


Sources and Further Reading