| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A C++ implementation of Git's core functionality, originally ported from a Java "gitlet" project. This is a fully functional version control system that handles repositories, commits, branches, merging, and more.
Currently tested and working on macOS. Windows and Linux support coming soon.
TODO: Add Windows and Linux compatibility
cmake -B build && make -C build# Build first
cmake -B build && make -C build
# Install to system PATH
sudo cp build/gitcpp /usr/local/bin/# Add to your ~/.zshrc or ~/.bashrc
export PATH="$PATH:/path/to/git_cpp/build"After installation:
gitcpp <command> [args...]Or without installation:
./build/gitcpp <command> [args...]Create a .gitcppignore file in your repository root to ignore files and directories:
*.log temp/ build/ .DS_Store
Supports basic patterns:
When merging branches with conflicting changes, gitcpp will create conflict markers in affected files:
<<<<<<< HEAD Current branch content ======= Other branch content >>>>>>> branch_name
Resolve conflicts by editing the file, then add and commit the resolved version.
gitcpp stores all data in a .gitcpp/ directory:
Try this 5-minute walkthrough to see gitcpp in action:
# Build the project
cmake -B build && make -C build
# Create a test directory
mkdir gitcpp_demo && cd gitcpp_demo
# Initialize repository
../build/gitcpp init
# Set up user info
../build/gitcpp config user.name "Demo User"
../build/gitcpp config user.email "demo@example.com"
# Create and add a file
echo "Hello gitcpp!" > hello.txt
../build/gitcpp add hello.txt
../build/gitcpp commit "Initial commit"
# Create a branch and make changes
../build/gitcpp branch feature
../build/gitcpp switch feature
echo "Feature branch changes" >> hello.txt
../build/gitcpp add hello.txt
../build/gitcpp commit "Add feature"
# Switch back and merge
../build/gitcpp switch main
../build/gitcpp merge feature
# Check the result
../build/gitcpp log
cat hello.txtExpected output: You should see both commits in the log and the merged content in hello.txt.
# Create files to ignore
echo "debug info" > debug.log
mkdir temp && echo "temp file" > temp/cache.txt
# Create ignore file
echo "*.log" > .gitcppignore
echo "temp/" >> .gitcppignore
# Check status - ignored files won't show up
../build/gitcpp statusThe project includes Google Test-based unit tests to verify functionality:
# Build tests (included in main build)
cmake -B build && make -C build
# Run tests (work in progress - some tests need isolation fixes)
./build/tests/gitcpp_testsNote: Test suite is currently being refined to properly isolate test environments.
| Back | FazBrowse Home | New Git URL |