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
- Overview
- Install Julia
- First steps with Julia
- Install and configure Git
- Create a GitHub account and authenticate
- Basic Git/GitHub Workflow
- Install and use VS Code
- Julia + VS Code Integration
- Git/GitHub + VS Code Integration
- End-to-end Mini-project
- 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:
Simple option: search for “Julia” in the Microsoft Store and install it (this installs
juliaup).Command line option: in PowerShell, type:
winget install julia -s msstore
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 | shFollow 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 --versionYou 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 version3. 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> statusReturn 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)
endExecute it from the terminal:
julia hello.jlProject 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 DataFramesThis 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 ToolsLinux (Debian/Ubuntu):
sudo apt update && sudo apt install gitLinux (Fedora):
sudo dnf install git
Verify
git --versionInitial 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 CodeVerify:
git config --list5. Create a GitHub account and authenticate
Create the account
- Go to https://github.com and click Sign up.
- Choose a username, email, and password.
- 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)
- On GitHub: Settings → Developer settings → Personal access tokens → Tokens (classic) → Generate new token.
- Check at least the
reposcope. Copy the token (it won’t be shown again). - The first time you do
git push, Git will ask for a username + password: enter your username, and paste the token as the password. - 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)
Generate a key:
ssh-keygen -t ed25519 -C "votre.email@exemple.com"Press Enter to accept the default location.
Display the public key:
cat ~/.ssh/id_ed25519.pubCopy it, then on GitHub: Settings → SSH and GPG keys → New SSH key, paste it.
Test:
ssh -T git@github.comYou should see:
Hi <name>! You've successfully authenticated...
With SSH, use repository URLs starting with
git@github.com:.... With HTTPS, usehttps://github.com/....
6. Basic Git/GitHub Workflow
Key concepts
- Repository: folder tracked by Git.
- Commit: a “snapshot” of your code at a given time, with a message.
- Branch: a parallel line of development
(
mainby default). - Remote: a distant copy of the repository (on
GitHub), named
origin. - Cycle:
modify → add → commit → push.
Scenario 1: start a local project and push it to GitHub
Create an empty repository on GitHub (New button, without README for simplicity).
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-projectThe 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 changesWorking with branches
git switch -c new-feature # create + switch to a branch
# ... work, commits ...
git push -u origin new-featureThen, 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.
- Windows: during installation, check “Add to PATH” and “Open with Code” (context menu).
- macOS: drag the app into Applications, then in VS
Code, open the command palette (
Cmd+Shift+P) → “Shell Command: Install ‘code’ command in PATH”. - Linux:
.deb/.rpmpackage or via the package manager.
Interface landmarks
- Left sidebar: File Explorer, Search, Source Control (Git), Extensions, Debug.
- Command Palette:
Ctrl+Shift+P(Cmd+Shift+Pon Mac) — everything is accessible here. - Integrated Terminal:
Ctrl+` (or menu Terminal → New Terminal).
Install an extension
Extensions icon (squares) in the left bar → search by name → Install.
8. Julia + VS Code Integration
Install the Julia extension
- Open Extensions, search for “Julia” (publisher: julialang).
- 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
- Syntax highlighting, autocompletion, hover info.
- Integrated Julia REPL:
Ctrl+Shift+P→ Julia: Start REPL (orAlt+J Alt+O). - Execute a line / selection:
Shift+Enter(sends to REPL). - Execute whole file:
Ctrl+Shift+P→ Julia: Execute File, or the ▶ button in the top right. - Workspace explorer and Plots in dedicated panels.
- Debugger: clickable breakpoints in the margin, step-by-step execution.
Quick trial
Open your project folder: File → Open Folder.
Create
test.jl:x = collect(1:10) total = sum(x) println("The sum is ", total)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)
- Open the Source Control tab (branch icon, left bar)
or
Ctrl+Shift+G. - Modified files appear. Click on + to stage them.
- Write a commit message at the top, then click the Commit button (checkmark icon).
- 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
- Install the “GitHub Pull Requests” extension (publisher: GitHub).
- Sign in to GitHub via the popup (or Accounts, icon at bottom left).
- 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 initIn VS Code (Open Folder on calc-stats), open
the Julia REPL and create the environment:
(@v1.11) pkg> activate .
(@v1.11) pkg> add StatisticsCreate 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 mainCongratulations: 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
- Julia Documentation: https://docs.julialang.org
- Pkg.jl (package management): https://pkgdocs.julialang.org
- Pro Git (free book): https://git-scm.com/book/en/v2
- Julia extension for VS Code: https://www.julia-vscode.org
- GitHub Docs: https://docs.github.com/en