Because Unraid runs entirely in RAM (unpacked from your USB flash drive at boot), the /root directory is essentially a temporary filesystem. When you rebooted, your original .gitconfig and .git-credentials were wiped, and the fresh OS image didn’t have the credential.helper instruction, causing Git to default back to manual prompts.
How to make this survive a reboot
To keep this working on Unraid, you need to store those files on your Flash drive or an Array/Cache disk and link them back at boot.
1. Move the files to your USB Flash (Persistent Storage):
The /boot directory on Unraid is your physical USB drive.
# Create a folder for your configs on the flash drive
mkdir -p /boot/config/git
# Move your working files there
cp /root/.gitconfig /boot/config/git/.gitconfig
cp /root/.git-credentials /boot/config/git/.git-credentials
2. Automate the restore with go script:
Unraid runs a script at /boot/config/go every time it starts up. Add these lines to the end of that file to copy your configs back to /root on every boot:
# Append these to /boot/config/go
cp /boot/config/git/.gitconfig /root/.gitconfig
cp /boot/config/git/.git-credentials /root/.git-credentials
chmod 600 /root/.git-credentials
fix-boot-config-git.sh
#!/bin/bash
GO_FILE="/boot/config/go"
GIT_DIR="/boot/config/git"
echo "--- 🚀 Initializing Persistent Git Setup ---"
# 1. Ensure persistent directory exists on Flash drive
if [[ ! -d "$GIT_DIR" ]]; then
echo " Creating $GIT_DIR..."
mkdir -p "$GIT_DIR"
fi
# 2. Migrate existing files and create symlinks
for file in .gitconfig .git-credentials; do
# If it's a real file (not a link), move it to Flash
if [[ -f "/root/$file" && ! -L "/root/$file" ]]; then
echo " Moving existing $file to persistent storage..."
mv "/root/$file" "$GIT_DIR/"
fi
# Create or refresh the symlink in /root
# -f ensures we overwrite any existing file or broken link
echo " Linking /root/$file -> $GIT_DIR/$file"
ln -sf "$GIT_DIR/$file" "/root/$file"
done
# 3. Interactive Identity Setup
# Note: Since .gitconfig is now a link, these commands write to the USB drive
CURRENT_EMAIL=$(git config --global user.email)
CURRENT_NAME=$(git config --global user.name)
if [[ -z "$CURRENT_EMAIL" ]]; then
read -p " Enter your Git email: " NEW_EMAIL
git config --global user.email "$NEW_EMAIL"
fi
if [[ -z "$CURRENT_NAME" ]]; then
read -p " Enter your Git name: " NEW_NAME
git config --global user.name "$NEW_NAME"
fi
# 4. Clean up old 'cp' logic from the 'go' script to avoid conflicts
if grep -q "cp /boot/config/go-git" "$GO_FILE"; then
echo " Cleaning up legacy 'cp' commands in $GO_FILE..."
sed -i '/cp \/boot\/config\/go-git/d' "$GO_FILE"
fi
# 5. Ensure symlinks are recreated on every boot via the 'go' script
# We use grep to check if the EXACT link command is already there
LINK_CMD_1="ln -sf $GIT_DIR/.gitconfig /root/.gitconfig"
LINK_CMD_2="ln -sf $GIT_DIR/.git-credentials /root/.git-credentials"
for cmd in "$LINK_CMD_1" "$LINK_CMD_2"; do
if ! grep -Fxq "$cmd" "$GO_FILE"; then
echo " Inserting $cmd before emhttp..."
# This sed command inserts the link line BEFORE the line containing 'emhttp'
sed -i "/\/usr\/local\/sbin\/emhttp/i $cmd" "$GO_FILE"
fi
done
echo "--- ✅ Setup Complete! ---"
echo "Current Identity: $(git config --global user.name) <$(git config --global user.email)>"
cat /boot/config/go
#!/usr/bin/bash
# ===================================================
# == Anyhing added must be available without ARRAY ==
# == -- Basically (/root, /etc, /bin, or /var) ==
# ===================================================
# == See post for description ==
# == https://frank-earnhardt.duckdns.org/2026/03/01/how-does-vm-overcommit_memory1-impact-unraid/
# vm.overcommit_memory=1
# == Copy DIR_COLORS and add eval dircolors ==
cp /boot/config/DIR_COLORS /root/.dircolors
cat /boot/config/go-dircolors.cfg >> /root/.bash_profile
# == Add Exports ==
echo 'export HISTCONTROL="ignoreboth:erasedups"' >> /root/.bash_profile
echo 'export WORK="/mnt/user/WORK"' >> /root/.bash_profile
# == Append additional config files ==
cat /boot/config/go-docker-compose.cfg >> /root/.bash_profile
cat /boot/config/go-aliases.cfg >> /root/.bash_profile
cat /boot/config/go-prompt.cfg >> /root/.bash_profile
# == Link in git config files ==
ln -sf /boot/config/git/.gitconfig /root/.gitconfig
ln -sf /boot/config/git/.git-credentials /root/.git-credentials
# == Start Management Utility GUI ==
ln -sf /boot/config/git/.gitconfig /root/.gitconfig
ln -sf /boot/config/git/.git-credentials /root/.git-credentials
/usr/local/sbin/emhttp
