Downloadable versions: PDF · Markdown

Tutorial: Install and Use Julia, Git/GitHub, and VS Code (from scratch)

This tutorial starts from scratch. It is aimed at someone who has never installed these tools. It covers Windows, macOS, and Linux. Follow the section corresponding to your system, then the common sections.


Table of Contents

  1. Overview
  2. Install Julia
  3. First steps with Julia
  4. Install and configure Git
  5. Create a GitHub account and authenticate
  6. Basic Git/GitHub Workflow
  7. Install and use VS Code
  8. Julia + VS Code Integration
  9. Git/GitHub + VS Code Integration
  10. End-to-end Mini-project
  11. Troubleshooting (FAQ)

1. Overview

Three tools, three roles:

Tool Role
Julia Programming language for scientific and numerical computing.
Git Version control system (local code history tracking).
GitHub Online service hosting Git repositories (backup, sharing, collaboration).
VS Code Code editor that brings it all together: editing, executing Julia, and Git/GitHub interface.

Git ≠ GitHub. Git is the software installed on your machine. GitHub is a website that hosts your Git repositories. You can use Git without GitHub.


2. Install Julia

The recommended method today is juliaup, the official Julia version manager. It installs Julia, manages updates, and allows multiple versions in parallel.

Windows

Open PowerShell or the Microsoft Store:

macOS

In the Terminal:

curl -fsSL https://install.julialang.org | sh

(You can also use Homebrew: brew install juliaup.)

Linux

In a terminal:

curl -fsSL https://install.julialang.org | sh

Follow the on-screen instructions. Close and reopen your terminal at the end so the PATH is updated.

Verify the installation

In a new terminal, type:

julia --version

You should see something like julia version 1.11.x.

Useful juliaup commands

juliaup status          # installed versions
juliaup update          # update Julia
juliaup add lts         # install the "long-term support" version
juliaup default release  # choose the default version

3. First steps with Julia

The REPL

Launch Julia by typing julia in a terminal. You will get the REPL (interactive prompt):

julia> 1 + 1
2

julia> println("Hello, Julia!")
Hello, Julia!

To quit: exit() or Ctrl-D.

The four REPL modes

Type these characters at the beginning of the line to change mode:

Key Mode Usage
(default) Julia Execute code.
] Pkg Manage packages (add, rm, status).
? Help Show help for a function.
; Shell Execute a system command.

Press Backspace on an empty line to return to Julia mode.

Install a package

Switch to Pkg mode with ], then:

(@v1.11) pkg> add Example
(@v1.11) pkg> status

Return to Julia mode (Backspace) and use it:

julia> using Example
julia> hello("world")
"Hello, world"

Execute a script file

Create a file hello.jl:

# hello.jl
for i in 1:3
    println("Iteration ", i)
end

Execute it from the terminal:

julia hello.jl

Project environments (best practice)

So a project has its own dependencies, create/activate an environment in the project folder:

(@v1.11) pkg> activate .
(@v1.11) pkg> add DataFrames

This creates two files, Project.toml and Manifest.toml, describing exactly the packages used. Version Project.toml with Git so the project is reproducible.


4. Install and configure Git

Installation

Windows: download “Git for Windows” at https://git-scm.com/download/win then run the installer (default options are fine). This also installs Git Bash, a handy terminal.

macOS:

brew install git        # with Homebrew
# or simply:
git --version           # prompts to install Command Line Tools

Linux (Debian/Ubuntu):

sudo apt update && sudo apt install git

Linux (Fedora): sudo dnf install git

Verify

git --version

Initial Configuration (to be done once)

Indicate your identity (it will appear in each commit):

git config --global user.name "Your Name"
git config --global user.email "votre.email@exemple.com"

A few comfortable settings:

git config --global init.defaultBranch main   # main branch "main"
git config --global pull.rebase false          # default merge strategy
git config --global core.editor "code --wait"  # edit messages in VS Code

Verify:

git config --list

5. Create a GitHub account and authenticate

Create the account

  1. Go to https://github.com and click Sign up.
  2. Choose a username, email, and password.
  3. Enable two-factor authentication (2FA): it’s now mandatory to contribute.

Authenticate from your machine

Since 2021, GitHub no longer accepts passwords for command-line Git operations. Two common methods:

Method A — HTTPS + Personal Access Token (simplest)

  1. On GitHub: Settings → Developer settings → Personal access tokens → Tokens (classic) → Generate new token.
  2. Check at least the repo scope. Copy the token (it won’t be shown again).
  3. The first time you do git push, Git will ask for a username + password: enter your username, and paste the token as the password.
  4. To avoid typing it again, install a credential manager:
    • Windows: already included (Git Credential Manager).
    • macOS: git config --global credential.helper osxkeychain
    • Linux: git config --global credential.helper "cache --timeout=3600"

Method B — SSH (practical in the long run)

  1. Generate a key:

    ssh-keygen -t ed25519 -C "votre.email@exemple.com"

    Press Enter to accept the default location.

  2. Display the public key:

    cat ~/.ssh/id_ed25519.pub
  3. Copy it, then on GitHub: Settings → SSH and GPG keys → New SSH key, paste it.

  4. Test:

    ssh -T git@github.com

    You should see: Hi <name>! You've successfully authenticated...

With SSH, use repository URLs starting with git@github.com:.... With HTTPS, use https://github.com/....


6. Basic Git/GitHub Workflow

Key concepts

Scenario 1: start a local project and push it to GitHub

  1. Create an empty repository on GitHub (New button, without README for simplicity).

  2. Locally:

    mkdir my-project && cd my-project
    git init
    echo "# My project" > README.md
    git add README.md
    git commit -m "First commit"
    git branch -M main
    git remote add origin https://github.com/<username>/my-project.git
    git push -u origin main

Scenario 2: retrieve an existing project

git clone https://github.com/<username>/my-project.git
cd my-project

The daily cycle

git status              # see modified files
git add file.jl         # add to "staging area" (or: git add .)
git commit -m "Describe change"
git push                # send to GitHub
git pull                # fetch remote changes

Working with branches

git switch -c new-feature   # create + switch to a branch
# ... work, commits ...
git push -u origin new-feature

Then, on GitHub, open a Pull Request to propose merging into main.

The .gitignore file

Prevents versioning certain files. For a Julia project, a good start:

# Julia
/Manifest.toml      # optional: version for exact reproducibility
*.jl.cov
*.jl.*.cov
/docs/build/
.DS_Store

For an application or reproducible work, also version Manifest.toml. For a reusable package, it’s often ignored.


7. Install and use VS Code

Installation

Download VS Code at https://code.visualstudio.com and install it.

Interface landmarks

Install an extension

Extensions icon (squares) in the left bar → search by name → Install.


8. Julia + VS Code Integration

Install the Julia extension

  1. Open Extensions, search for “Julia” (publisher: julialang).
  2. Click Install.

The extension normally detects Julia automatically (thanks to juliaup). Otherwise, set the path: Ctrl+, → search julia executable path → indicate the path to the Julia executable.

Main features

Quick trial

  1. Open your project folder: File → Open Folder.

  2. Create test.jl:

    x = collect(1:10)
    total = sum(x)
    println("The sum is ", total)
  3. Place the cursor on a line and hit Shift+Enter: the line executes in the integrated REPL.

Select the project environment

At the bottom of the VS Code window, the Julia extension shows the active environment (e.g. Julia env: v1.11). Click it to choose your project’s environment (the one containing Project.toml). This is equivalent to activate ..


9. Git/GitHub + VS Code Integration

VS Code natively integrates Git, plus an extension for GitHub.

Source Control (integrated Git)

  1. Open the Source Control tab (branch icon, left bar) or Ctrl+Shift+G.
  2. Modified files appear. Click on + to stage them.
  3. Write a commit message at the top, then click the Commit button (checkmark icon).
  4. Click Sync Changes (or the arrows at the bottom) to push/pull.

You also see: - The current branch at the bottom left (click to change/create). - The differences (diff) by clicking a modified file. - The colored margins indicating added/modified lines.

GitHub Pull Requests Extension

  1. Install the “GitHub Pull Requests” extension (publisher: GitHub).
  2. Sign in to GitHub via the popup (or Accounts, icon at bottom left).
  3. You can then create/review Pull Requests and manage issues directly in VS Code.

Publish a local project to GitHub in one click

If your folder isn’t a repository yet: Source Control tab → Publish to GitHub. VS Code creates the remote repository and pushes the code for you (public or private as chosen).


10. End-to-end Mini-project

Let’s put it all together.

# 1. Create the project
mkdir calc-stats && cd calc-stats
git init

In VS Code (Open Folder on calc-stats), open the Julia REPL and create the environment:

(@v1.11) pkg> activate .
(@v1.11) pkg> add Statistics

Create stats.jl:

using Statistics

data = [4, 8, 15, 16, 23, 42]
println("Mean: ", mean(data))
println("Standard deviation: ", std(data))

Execute it (Shift+Enter line by line, or ▶ button).

Create a .gitignore (see section 6), then version:

git add .gitignore Project.toml Manifest.toml stats.jl
git commit -m "Basic statistics project"

Publish on GitHub via Source Control → Publish to GitHub, or command line:

git branch -M main
git remote add origin https://github.com/<username>/calc-stats.git
git push -u origin main

Congratulations: you have a versioned Julia project, hosted on GitHub, controlled from VS Code.


11. Troubleshooting (FAQ)

julia: command not found after installation. Close and reopen the terminal. If the problem persists, the juliaup folder (~/.juliaup/bin) is not in the PATH — rerun the installer or add it manually.

git push is rejected / repeatedly asks for password. GitHub no longer accepts account passwords. Use a Personal Access Token (Method A) or SSH (Method B), section 5.

VS Code doesn’t find Julia. Ctrl+, → setting julia executable path → point to the executable (visible via which julia / where julia).

VS Code Julia REPL is slow on first launch. Normal: Julia precompiles packages the first time. Subsequent launches are fast.

“fatal: not a git repository”. You are not in a folder tracked by Git. Run git init, or navigate to the right folder.

Merge conflict. VS Code highlights conflicting areas with Accept Current / Incoming / Both buttons. Choose, save, then git add + git commit.


Going further