This tool generates a Gource visualization video from multiple Git repositories, combining them into a single timeline. It's perfect for visualizing the development history of related projects or microservices.
Before using this script, make sure you have the following installed:
- Gource - For Git repository visualization
- FFmpeg - For video encoding
- Bash shell
realpathcommand (usually comes with coreutils)
# Using Homebrew
brew install gource ffmpeg coreutilssudo apt-get install gource ffmpeg coreutils- Make the script executable:
chmod +x gource-multiple-repository.sh- Run the script with paths to your Git repositories:
./gource-multiple-repository.sh /path/to/repo1 /path/to/repo2 /path/to/repo3./gource-multiple-repository.sh \
~/projects/service-a \
~/projects/service-b \
~/projects/service-cThe script will:
- Generate a combined visualization of all repositories
- Create an MP4 video file named
gource.mp4in the current directory - Display a list of all committers across the repositories
- Show the total number of lines changed across all repositories
- Display the maximum number of lines changed in a single commit
- Combines multiple Git repositories into a single visualization
- Validates repository paths and Git status
- Highlights different users and directories
- Generates high-quality MP4 video (1920x1080 resolution)
- Shows file extensions
- Includes keyboard controls overlay
- Hides mouse cursor and filenames for cleaner visualization
- Enhanced visual effects with bloom and multi-sampling
- Optimized user scaling
- Displays total lines changed in the title
The default settings are:
- Resolution: 1920x1080 (Full HD)
- Speed: 0.4 (slower than real-time)
- Frame rate: 60 FPS
- Video codec: H.264
- Quality: High (CRF 1)
- Background: Black (#000000)
- Font size: 18px
- Font color: White (#FFFFFF)
- User scale: 1.5x
- Bloom effect: Customized for better visibility
- Title includes total lines changed statistic
You can customize the visualization by modifying these options in the script:
--background-colour: Change the background color (hex format)--font-size: Adjust the size of text--font-colour: Change the color of text (hex format)--title: Set a custom title for the visualization--user-scale: Adjust the size of user avatars--bloom-multiplierand--bloom-intensity: Fine-tune the bloom effect--disable-bloom: Remove the bloom effect entirely--multi-sampling: Enable anti-aliasing for smoother edges
If you encounter issues:
- Make sure all paths to repositories are correct
- Verify that each directory is a valid Git repository
- Ensure you have sufficient disk space for temporary files
- Check that Gource and FFmpeg are properly installed
- If using relative paths, make sure they are correct relative to your current directory
- If you get "unknown option" errors, check your Gource version with
gource --version - If repositories are not being recognized, ensure they have a
.gitdirectory - If the video is not generating, check if you have write permissions in the current directory
- If line change statistics are incorrect, check if your Git log format is standard
Common errors and solutions:
- "directory not supported": Make sure the path points to a valid Git repository
- "unknown option": Your version of Gource might not support some options. Try removing them from the script.
- "Could not find codec parameters": This usually means Gource failed to generate the visualization. Check the repository paths and permissions.
- "Total lines changed: 0": This might indicate an issue with the Git log format or that the repositories have no commits.
This script is open source and available under the MIT License.
Feel free to submit issues and enhancement requests!