KKIMS on-site docs
Your workstation

Git

Install Git on Linux, macOS and Windows, set your name and credential helper, handle line endings (.gitattributes, core.autocrlf) and long paths on Windows, and check it all.

You need Git to get the code, to push it to KIMS's Git, and (on Windows) for Git Bash. Any recent version works; the repository asks for nothing specific.

#Install

bash
# Ubuntu or Debian
sudo apt update && sudo apt install -y git
bash
# RHEL, Rocky, Alma, Fedora, Amazon Linux 2023
sudo dnf install -y git
bash
brew install git

Without Homebrew, xcode-select --install installs Apple's Command Line Tools, which include git. Homebrew itself is installed from https://brew.sh.

powershell
winget install -e --id Git.Git --source winget

The alternative is the installer from https://git-scm.com/download/win. Either way you get Git for Windows, which includes Git Bash, openssl, sed and the Git Credential Manager.

During the installer's questions (if you run it by hand), the defaults are fine. Two of them matter for this project:

  • "Configuring the line ending conversions": the default, "Checkout Windows-style, commit Unix-style line endings" (core.autocrlf=true), works with this repository because its .gitattributes forces LF where it matters. See Line endings.
  • "Choosing the default editor": pick one you know (Notepad or VS Code), not Vim, unless you use Vim.

Open a new terminal window after installing, so the new PATH is picked up.

#Check

text
git --version

You should see git version 2.x (for example git version 2.52.0; Windows adds .windows.1).

On Windows, also open Git Bash from the Start menu and run git --version there. A terminal window opens and prints the same version.

#Set your name and email

Git refuses to commit without them. They are written into any commit you make (you should rarely need to commit on site; you mostly push existing commits).

text
git config --global user.name "<YOUR_NAME>"
git config --global user.email "<YOUR_EMAIL>"

Check with git config --global --list.

#Credentials

#Credentials for GitHub (getting the code)

The code is at https://github.com/DayntTech/kims-v2, a private repository: you need a GitHub account with access, and git needs a way to authenticate. GitHub no longer accepts your account password for git. The simplest way on every system is the GitHub CLI, which signs you in through the browser and sets git up to use it:

bash
# Ubuntu or Debian: GitHub's apt repository
(type -p wget >/dev/null || sudo apt install -y wget) && sudo mkdir -p -m 755 /etc/apt/keyrings \
 && wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
 && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
 && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
 && sudo apt update && sudo apt install -y gh
bash
# RHEL family
sudo dnf install -y 'dnf-command(config-manager)' && sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo && sudo dnf install -y gh
bash
brew install gh
powershell
winget install -e --id GitHub.cli

Then, in a new window:

text
gh auth login
gh auth setup-git

Answer: GitHub.com, HTTPS, "Login with a web browser". gh auth status should then say Logged in to github.com account <you>.

If you cannot install gh: on Windows, Git Credential Manager (included) opens a browser sign-in the first time you clone. On macOS, git uses the Keychain (osxkeychain) and asks for a username and a personal access token (GitHub, Settings, Developer settings, Personal access tokens) as the password. On Linux, use a personal access token with git config --global credential.helper 'cache --timeout=28800' so it is remembered for 8 hours without being written to disk.

If GitHub cannot be reached at all from where you are, clone from the git bundle in the handover instead (Get the code).

#Credentials for KIMS's Git (pushing)

KIMS's Git may be GitHub, GitLab, Bitbucket, Azure DevOps or a self-hosted server. Ask KIMS which, and whether they want HTTPS with a token or SSH. Git Credential Manager (Windows, and installable on macOS and Linux) handles most hosted services through a browser sign-in. For SSH:

bash
ssh-keygen -t ed25519 -C "<YOUR_EMAIL>"
cat ~/.ssh/id_ed25519.pub
bash
ssh-keygen -t ed25519 -C "<YOUR_EMAIL>"
cat ~/.ssh/id_ed25519.pub
powershell
ssh-keygen -t ed25519 -C "<YOUR_EMAIL>"
Get-Content $HOME\.ssh\id_ed25519.pub

Give KIMS the .pub line (the public key) to add to your account on their Git. Never send the file without .pub. Test with ssh -T git@<KIMS_GIT_HOST>. The push itself is on Push the code.

#Line endings

#What the repository does

Linux and macOS end lines with LF; many Windows tools write CRLF. A shell script with CRLF fails on Linux with /bin/sh^M: bad interpreter or cannot execute: required file not found. This happened on the earlier platform: a Jenkins bootstrap script checked out on Windows with CRLF stopped Jenkins from starting.

So kims-v2/.gitattributes forces LF on checkout, whatever your settings, for:

text
*.sh                    text eol=lf
jenkins/**              text eol=lf
infra/lib/functions/**  text eol=lf
infra/lambda/**         text eol=lf
scripts/deploy/**       text eol=lf
scripts/bundle-hash.mjs text eol=lf

*.sh covers deploy/jenkins/check-environment.sh, deploy/entrypoint.sh and deploy/kind/*.sh. Files Node runs (.ts, .mjs, .js) are left to core.autocrlf, because Node reads CRLF fine.

Note

deploy/cloudfront/** (the CloudFront function you paste into the console) is not in main's list; the windows-fixes branch adds it. CloudFront accepts the code with CRLF, so on main this is harmless, but copy the function from a Linux or macOS checkout, or from the web view of KIMS's Git, if you want it byte-for-byte.

The Jenkins site job also drops carriage returns from the kims-site-env credential, so a settings file saved on Windows works.

#Your settings

bash
git config --global core.autocrlf input
bash
git config --global core.autocrlf input
powershell
git config --global core.autocrlf true

input on Linux and macOS converts any CRLF to LF when committing and never adds CR. true on Windows is Git for Windows's default: LF in the repository, CRLF in your working files except those .gitattributes forces to LF.

#"Modified" files that you did not change

On Windows with core.autocrlf=true, git status may list files as modified when only their line endings differ (seen with packages/db/src/cli.ts). Check:

text
git diff --ignore-cr-at-eol --stat

No output means the differences are line endings only. Do not commit them. To make them go away:

text
git add --renormalize .
git status

If they are still listed, git checkout -- <file> restores the committed version (this discards any real change you made to that file).

#Long paths on Windows

Windows limits paths to 260 characters unless long paths are switched on. A deep node_modules tree inside a long working folder can pass that limit, and Explorer's "Extract all" adds a folder level that pushed some handover files past it on the engineer's laptop.

Do both, in an Administrator PowerShell (right-click PowerShell, Run as administrator):

powershell
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
powershell
git config --system core.longpaths true

The first prints the new value; the second prints nothing. Restart Windows (or at least sign out and in) so every program sees the change. If you cannot get Administrator rights, use git config --global core.longpaths true (no admin needed) and keep your working folder short, for example C:\kims.

Linux and macOS have no such limit; skip this.

#Check everything

bash
git --version
git config --global --get core.autocrlf
gh auth status
bash
git --version
git config --global --get core.autocrlf
gh auth status
powershell
git --version
git config --get core.autocrlf
git config --get core.longpaths
(Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem").LongPathsEnabled
gh auth status

You should see a version, input (Linux and macOS) or true (Windows), on Windows true and 1 for the long path settings, and Logged in to github.com.

#If it goes wrong

What you see Cause Fix
git: command not found / 'git' is not recognized Not installed, or the window was open before installing Install, then open a new window
remote: Repository not found. on clone No access to the private repository, or signed in as the wrong account gh auth status; ask for access to DayntTech/kims-v2; or clone from the bundle
Support for password authentication was removed Typed your GitHub password Use gh auth login, or a personal access token
Filename too long on Windows Long paths off Long paths on Windows
/bin/sh^M: bad interpreter running a .sh The file has CRLF (copied or edited on Windows outside Git) Check out again from Git; or sed -i 's/\r$//' <file> in Git Bash
Many files show as modified right after clone on Windows Line endings only Modified files that you did not change
fatal: detected dubious ownership in repository The folder belongs to another user (common in containers and shared drives) git config --global --add safe.directory <path>
PowerShell shows git output in red git writes progress to stderr Nothing is wrong; check the last line and $LASTEXITCODE

#Sources

Built 2026-11-29. Commands are shown for the system picked at the top; every block has all three.