Getting Started
Get started with Freestyle's hosted Git service for managing repositories with identity-based access control and automation.
Getting Started
Freestyle provides a hosted Git service with identity-based access control, automation triggers, and GitHub synchronization. You can create repositories, grant granular permissions, set up webhooks, and access repository contents programmatically.
Creating Your First Repository
import { FreestyleSandboxes } from "freestyle-sandboxes";
const sandboxes = new FreestyleSandboxes({
apiKey: "your-api-key",
});
// Create a basic repository
const repo = await sandboxes.createGitRepository({
name: "my-first-repo",
});
console.log(`Repository created: ${repo.repoId}`);Once created, you can push code to your repository:
git remote add freestyle https://git.freestyle.sh/your-repo-id
git push freestyle mainYou can also create repositories by forking existing Git repositories or importing static content from archives. See Managing Repositories for more options.
Next Steps
- Set up access control to grant permissions to users or CI systems
- Create triggers to automate workflows
- Sync with GitHub for collaboration
- Access repository contents through our APIs
Authentication
To use Git CLI operations with Freestyle repositories:
git config --global credential.helper store
echo "https://x-access-token:your-token@git.freestyle.sh" >> ~/.git-credentialsThis will set your git credentails globally. On a shared machine or personal computer, use --local instead of --global to scope configuration to the current repository.
For server-side authentication with your Freestyle API key:
git -c http.extraHeader "Authorization: Bearer <your-api-key>" clone https://git.freestyle.sh/your-repo-idAPI Reference
See the API Reference for complete endpoint documentation.