Skip to main content
This example demonstrates how to work with Git repositories in Daytona sandboxes, including cloning, status checking, and using the Language Server Protocol (LSP).

What You’ll Learn

  • Cloning Git repositories
  • Pulling latest changes
  • Checking repository status
  • Listing branches
  • Integrating with LSP for code intelligence
  • Finding and modifying code

Complete Example

Expected Output

Key Concepts

Cloning Repositories

Clone any public or private Git repository:

Git Status and Branches

Check repository status and available branches:

Language Server Protocol (LSP)

Use LSP for code intelligence:
Supported LSP languages:
  • typescript / javascript
  • python
  • go
  • rust
  • java
  • And more…

Finding Code

Search for code patterns across files:

Common Workflows

Clone, Modify, and Analyze

Code Intelligence Workflow

Best Practices

Use shallow clones: For large repositories, consider cloning only recent history to save time and space.
Authentication: For private repositories, use personal access tokens instead of passwords. Store tokens securely.
LSP Performance: LSP servers may take a moment to initialize. Wait for initialization before requesting completions or symbols.

Next Steps

Code Execution

Execute code in sandboxes

File Operations

Advanced file manipulation