Skip to content

Optimize git operations to only clone main branch#5

Merged
robdimarco-atxp merged 1 commit intomainfrom
robdimarco/atxp-250-the-cli-should-only-get-main-branch-when-cloning-the-demo
Sep 9, 2025
Merged

Optimize git operations to only clone main branch#5
robdimarco-atxp merged 1 commit intomainfrom
robdimarco/atxp-250-the-cli-should-only-get-main-branch-when-cloning-the-demo

Conversation

@robdimarco-atxp
Copy link
Contributor

Summary

  • Optimize git clone operations to reduce data transfer by only downloading the main branch with shallow history
  • Apply optimizations to both demo cloning and project template cloning operations
  • Maintain performance improvements for git pull operations on existing repositories

Changes

  • Shallow clone: Added --depth 1 to download only the latest commit instead of full history
  • Single branch: Added --single-branch to avoid downloading other branches
  • Explicit branch: Added --branch main to explicitly target the main branch
  • Optimized updates: Modified git pull to use --depth 1 and explicitly pull from origin main
  • Documentation: Added comprehensive tests to document the expected git parameters

Performance Impact

  • Reduced bandwidth: Significantly less data downloaded during git operations
  • Faster clone times: Only downloading latest commit instead of full repository history
  • Smaller disk usage: Repositories take up less space without full git history

Test plan

  • Build and typecheck passes
  • All existing tests pass
  • New git optimization tests pass
  • Manual testing confirms demo command works with optimized clone
  • Verified shallow clone creates repository with only 1 commit in history
  • Lint checks pass

Fixes: https://linear.app/novellum/issue/ATXP-250/the-cli-should-only-get-main-branch-when-cloning-the-demo

🤖 Generated with Claude Code

- Use shallow clone (--depth 1) to download only the latest commit
- Add --single-branch flag to avoid downloading other branches
- Explicitly target main branch with --branch main
- Optimize git pull to maintain shallow history during updates
- Add comprehensive tests documenting git optimization parameters

This reduces data transfer and improves clone performance for both demo and create commands.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@linear
Copy link

linear bot commented Sep 9, 2025

ATXP-250 The CLI should only get main branch when cloning the demo

When cloning the demo, we do not need a git history and only need the main branch. Our current git clone gets the whole history. This is wasteful.

@robdimarco-atxp robdimarco-atxp merged commit 680b23b into main Sep 9, 2025
1 check passed
@robdimarco-atxp robdimarco-atxp deleted the robdimarco/atxp-250-the-cli-should-only-get-main-branch-when-cloning-the-demo branch September 9, 2025 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant