git-bolt
Version:
Git utilities for faster development
83 lines (58 loc) • 1.95 kB
Markdown
# Git Bolt
A Git client for webcontainers and environments without native Git support.
## Features
- Works in browser-based development environments like StackBlitz and CodeSandbox
- No native Git client required
- Supports all basic Git operations:
- Initialization and repository connection
- Adding and committing changes
- Pushing and pulling from remote
- Branch management
- Status viewing
## Quick Start
You can use this tool without installation via npx:
```bash
# Initialize a repo
npx git-bolt init https://github.com/yourusername/your-repo.git --token YOUR_GITHUB_TOKEN
# Add files
npx git-bolt add .
# Commit changes
npx git-bolt commit -m "Initial commit"
# Push to GitHub
npx git-bolt push
```
## Installation
If you prefer to install the package globally:
```bash
# Install globally
npm install -g git-bolt
# Use the command
git-bolt --help
```
## Authentication
You need a GitHub personal access token to authenticate. You can provide it in several ways:
1. Using the `--token` option with the `init` command
2. Setting the `GITHUB_TOKEN` environment variable
3. Creating a `.env` file with `GITHUB_TOKEN=your_token`
## Commands
- `init <repo-url>` - Initialize and connect to a GitHub repository
- `add <filepath>` - Add file(s) to the staging area
- `commit -m "message"` - Commit staged changes
- `push [-b branch]` - Push commits to remote repository
- `pull [-b branch]` - Pull latest changes from remote repository
- `branch [name] [-c]` - List, create, or checkout branches
- `fetch [-b branch]` - Fetch latest changes from remote repository
- `status` - Show the working tree status
## Contributing
If you're contributing to this project and need to publish, follow these steps:
1. Create an npm account if you don't have one at [npmjs.com](https://www.npmjs.com/signup)
2. Login to npm:
```bash
npm login
```
3. Publish the package:
```bash
npm publish
```
## License
MIT