A fresh Linux workstation can have a working terminal and still fail the first repository task when compilers, Git identity, SSH access, editor defaults, or a project directory are missing. Bootstrapping those pieces before cloning or building code gives the local account a known starting point instead of discovering gaps during the first handoff.
The commands use APT on Ubuntu or Debian because package names and sudo behavior are predictable there. The same checklist can be adapted to other distributions by replacing the package installation step with the equivalent dnf, zypper, pacman, or vendor package workflow.
Run user-level Git and SSH commands as the account that will own the projects, not through sudo. Package installation needs administrative privileges, while identity, key, editor, and project-directory settings belong in the normal user's home directory.
Related: Install Git on Ubuntu
Related: Configure Git user name and email
Related: Create an SSH key pair
Keep the same user account for the Git, SSH, and project-directory steps. Running those commands with sudo writes settings under root instead of the developer account.
$ sudo apt update
$ sudo apt install --assume-yes build-essential git curl ca-certificates openssh-client gnupg jq unzip zip python3 python3-venv python3-pip nano
build-essential installs the default compiler and make tools. python3-venv lets the account create isolated Python environments without modifying system packages.
$ dpkg-query -W build-essential git openssh-client python3-venv build-essential 12.12ubuntu2 git 1:2.53.0-1ubuntu1 openssh-client 1:10.2p1-2ubuntu3.2 python3-venv 3.14.3-0ubuntu2
Exact versions depend on the distribution release and enabled update repositories. The package names should appear instead of a no packages found message.
$ git config set --global user.name "Example User"
$ git config set --global user.email "user@example.net"
Use the email address that should appear in commits from this workstation.
Related: Configure Git user name and email
$ git config set --global init.defaultBranch main
Replace main with the branch name used by your projects when a different default is required.
Related: Change the default branch for new Git repositories
$ git config set --global core.editor nano
Use a different installed editor when preferred. For editor settings used by non-Git tools, set $VISUAL and $EDITOR in the shell startup file.
Related: How to change the default editor in Linux
$ git config list --global user.name=Example User user.email=user@example.net init.defaultbranch=main core.editor=nano
$ ssh-keygen -t ed25519 -C "user@workstation" Generating public/private ed25519 key pair. Enter file in which to save the key (/home/user/.ssh/id_ed25519): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/user/.ssh/id_ed25519 Your public key has been saved in /home/user/.ssh/id_ed25519.pub The key fingerprint is: SHA256:tXtH/VwGC1b/CcB0r8WKV05KG2Lv9QPjjFZBJcE9xvY user@workstation ##### snipped #####
Do not overwrite an existing private key unless it is intentionally being replaced. Use a passphrase for an interactive user's private key, and copy only the .pub file to servers or Git hosting services.
Related: Create an SSH key pair
$ ssh-keygen -lf ~/.ssh/id_ed25519.pub 256 SHA256:tXtH/VwGC1b/CcB0r8WKV05KG2Lv9QPjjFZBJcE9xvY user@workstation (ED25519)
$ cat ~/.ssh/id_ed25519.pub ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGU+H7TrzzwHtzv7fHyoptsyFjbULDrpf/DMMD7lyeSs user@workstation
Never paste the private key from ~/.ssh/id_ed25519 into a ticket, chat, browser form, or server authorized_keys file.
Related: Copy an SSH public key to a server
$ mkdir -p ~/src
$ mkdir -p ~/src/workstation-check
$ cd ~/src/workstation-check
$ git init --initial-branch=main Initialized empty Git repository in /home/user/src/workstation-check/.git/
The explicit --initial-branch=main keeps this smoke test independent of any older default branch setting.
$ python3 -m venv .venv
No output indicates the virtual environment was created. If this fails, confirm python3-venv is installed for the active distribution release.
$ git commit --allow-empty -m "Check workstation" [main (root-commit) eeb558d] Check workstation
This proves Git can write commits with the configured identity without adding sample project files.
$ git status --short --branch ## main
$ rm -rf ~/src/workstation-check
Run this command only for the temporary check directory created above. Keep real project directories under ~/src.