No description
- Shell 100%
| LICENCE.md | ||
| ram | ||
| README.md | ||
ram - High-Performance RAM Workspace for Git Repositories
ram is a lightweight Bash utility designed primarily for Linux systems and SBCs like the Raspberry Pi. It mounts a temporary workspace inside RAM (/dev/shm), drastically reducing SD card write wear and accelerating file operations and build/compilation times.
Key Features
- GNU Screen Session Protection: Encapsulates the entire RAM session within GNU
screen(ram-<repo-name>). If an SSH connection drops, network breaks, or the terminal window closes accidentally, the workspace and in-progress processes remain alive in RAM. Simply re-runram(orscreen -r) to reattach immediately. - SD Card Lifespan Protection: Intermediate build files (
.o, build logs, binary artifacts) are generated inside RAM (tmpfs) and never touch the SD card. - Direct Git Proxy: Symlinks the
.gitdirectory back to disk. Everygit commit,git branch, orgit addexecuted inside RAM updates your on-disk repository instantly. - Smart
.gitignoreFiltering: Leveragesrsync --filter=':- .gitignore'on exit:- Tracked source files & persistent untracked files (e.g.
notes.txt,.env) are mirrored back to disk. - Ignored build artifacts are automatically scrapped when the session ends.
- Tracked source files & persistent untracked files (e.g.
- Safety Traps: Gracefully captures
exit,Ctrl+D,Ctrl+C(SIGINT),SIGTERM, and terminal hangups (SIGHUP) to guarantee changes sync back before cleaning up RAM when exiting. - Visual Prompt Indicator: Spawns an interactive shell with a contextual prompt (
[RAM:repo-name]) displaying paths relative to the project root when inside the RAM workspace, and standard paths when outside. - Quick Return (
ram): Runningramwithout arguments inside the subshell acts likecd, quickly returning you to the root of the RAM workspace.
License
CC0 1.0 Universal (Public Domain Dedication). Feel free to use, modify, and share without restrictions!
Installation & Requirements
Ensure rsync and screen (GNU screen) are installed:
sudo apt install rsync screen
Drop the ram script somewhere in your PATH (e.g. ~/.local/bin/ram or /usr/local/bin/ram).
Navigate to any Git repository root and run ram (or run ram <path-to-repo>). If a session for that repository is already running (e.g. after an SSH disconnection), ram automatically reattaches to it!