This comprehensive guide covers all supported installation methods for gitignore across different platforms and environments.
| Component | Requirement | Notes |
|---|---|---|
| Operating System | Linux, macOS 10.12+, Windows 10+ | Cross-platform C application |
| Processor | x86_64, ARM64 | Native architecture support |
| Memory | 256 MB RAM | Minimal runtime footprint |
| Storage | 50 MB | Includes source, build artifacts |
| Network | Optional | Required for GitHub sync features |
| Component | Version | Purpose |
|---|---|---|
| GCC/Clang | 4.8+ / 3.5+ | C compiler |
| GNU Make | 3.81+ | Build system |
| libcurl | 7.50+ | HTTP client library |
| Git | 2.0+ | Version control (optional) |
The fastest way to install gitignore with zero configuration:
curl -fsSL https://raw.githubusercontent.com/mahbubhs/gitignore/main/install.sh | bash
What this does:
/usr/local/bin (sudo required)Exit codes:
0: Success1: Download failed2: Verification failed3: Installation failed# Ubuntu, Debian, Pop!_OS, etc.
sudo apt-get update && sudo apt-get install -y curl && \
curl -fsSL https://raw.githubusercontent.com/mahbubhs/gitignore/main/install.sh | bash
# Fedora, RHEL, CentOS
sudo dnf install -y curl && \
curl -fsSL https://raw.githubusercontent.com/mahbubhs/gitignore/main/install.sh | bash
# Using curl (built-in)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/mahbubhs/gitignore/main/install.sh)"
# Requires curl.exe in PATH
curl.exe -fsSL https://raw.githubusercontent.com/mahbubhs/gitignore/main/install.sh | bash.exe
Install to your home directory without administrator privileges:
# Install to ~/.local/bin
curl -fsSL https://raw.githubusercontent.com/mahbubhs/gitignore/main/install.sh | bash -s ~/.local
# Add to PATH (add to ~/.bashrc or ~/.zshrc)
export PATH="$HOME/.local/bin:$PATH"
# Install to /usr/local/bin (default)
curl -fsSL https://raw.githubusercontent.com/mahbubhs/gitignore/main/install.sh | sudo bash
# Install to custom system path
curl -fsSL https://raw.githubusercontent.com/mahbubhs/gitignore/main/install.sh | sudo bash -s /opt/bin
# Set custom installation prefix
export PREFIX=/opt/gitignore
curl -fsSL https://raw.githubusercontent.com/mahbubhs/gitignore/main/install.sh | sudo bash
sudo apt-get update
sudo apt-get install -y build-essential libcurl4-openssl-dev git
sudo dnf install -y gcc make libcurl-devel git
sudo pacman -S gcc make curl git
# Install Xcode Command Line Tools
xcode-select --install
# Install Homebrew (optional, for additional tools)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install dependencies
brew install curl git
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-curl mingw-w64-x86_64-make git
Clone the repository:
git clone https://github.com/mahbubhs/gitignore.git
cd gitignore
Generate template database:
make templates
This creates src/templates.c from templates/*.gitignore files.
Compile the application:
make
This produces the gitignore binary.
Install (optional):
sudo make install
Verify installation:
./gitignore --version
./gitignore --help
make CFLAGS="-g -O0 -Wall -Wextra" LDFLAGS="-g"
make CFLAGS="-O3 -march=native -flto" LDFLAGS="-flto"
# ARM64 cross-compilation
make CC=aarch64-linux-gnu-gcc
make CC=clang
sudo snap install gitignore --edge
sudo snap connect gitignore:home # Optional: access home directory
brew tap mahbubhs/gitignore
brew install gitignore
Note: Homebrew formula pending official publication.
# Pull and run
docker run --rm -v $(pwd):/workspace ghcr.io/mahbubhs/gitignore:latest --help
# Build locally
docker build -t gitignore .
# shell.nix
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = with pkgs; [
(import (fetchTarball "https://github.com/mahbubhs/gitignore/archive/main.tar.gz") {})
];
}
# Check installation
which gitignore
gitignore --version
# Test core functionality
gitignore --help
gitignore list
# Create test environment
mkdir /tmp/gitignore-test && cd /tmp/gitignore-test
# Test template initialization
gitignore init python
cat .gitignore
# Test auto-detection (create package.json first)
echo '{}' > package.json
gitignore auto
# Test pattern addition
gitignore *.log .env
# Cleanup
cd / && rm -rf /tmp/gitignore-test
# Test with Git
git init /tmp/test-repo
cd /tmp/test-repo
gitignore init rust
git status
# Install curl first
# Ubuntu/Debian
sudo apt-get install curl
# macOS
# curl is built-in, check PATH
which curl
# Use sudo for system directories
curl -fsSL https://raw.githubusercontent.com/mahbubhs/gitignore/main/install.sh | sudo bash
# Or install to user directory
curl -fsSL https://raw.githubusercontent.com/mahbubhs/gitignore/main/install.sh | bash -s ~/.local
# Install build tools
# Ubuntu/Debian
sudo apt-get install build-essential
# macOS
xcode-select --install
# Install development headers
# Ubuntu/Debian
sudo apt-get install libcurl4-openssl-dev
# Check library path
pkg-config --libs libcurl
# Check compiler version
gcc --version
# Clean and rebuild
make clean
make
# Verbose build output
make V=1
# Check template files exist
ls -la templates/
# Check script permissions
chmod +x scripts/generate_templates.sh
# Manual generation
./scripts/generate_templates.sh
# Check PATH
echo $PATH
which gitignore
# Add to PATH
export PATH="/usr/local/bin:$PATH"
# Check dynamic linking
ldd $(which gitignore)
# Reinstall dependencies
sudo apt-get install --reinstall libcurl4-openssl-dev
# Re-run installation script
curl -fsSL https://raw.githubusercontent.com/mahbubhs/gitignore/main/install.sh | bash
# Update source
cd /path/to/gitignore/source
git pull
make clean
make templates
make
sudo make install
# Current version
gitignore --version
# Check for updates
curl -s https://api.github.com/repos/mahbubhs/gitignore/releases/latest | grep '"tag_name"' | cut -d'"' -f4
# Remove binary
sudo rm /usr/local/bin/gitignore
sudo rm /usr/local/share/man/man1/gitignore.1
# Remove user data
rm -rf ~/.config/gitignore
# From source directory
sudo make uninstall
# Manual cleanup
rm -rf ~/.config/gitignore
# Remove all traces
sudo rm -f /usr/local/bin/gitignore
sudo rm -f /usr/local/share/man/man1/gitignore.1
rm -rf ~/.config/gitignore
rm -rf ~/.cache/gitignore # If exists
| Method | Platforms | Root Required | Offline Capable |
|---|---|---|---|
| Automated Script | Linux, macOS, WSL | Optional | No |
| Source Build | All | Optional | Yes |
| Package Managers | Limited | Varies | Varies |
| Docker | All | No | No |
Once installed, explore: