Add setup guide: new device, new repo, existing repo, ginit helper

This commit is contained in:
akemmanuel
2026-02-09 17:01:20 -03:00
parent 730c037e4a
commit 1bcba666be

129
README.md
View File

@@ -1,3 +1,128 @@
# gitea-setup # Gitea Setup - git.idunara.com
How to set up Gitea CLI and repos on git.idunara.com Private Gitea instance at **https://git.idunara.com**
- SSH port: **222**
- Web: **https://git.idunara.com**
- CLI tool: [tea](https://gitea.com/gitea/tea)
---
## 1. New Device Setup
Run these steps once on any new machine.
### Install tea
```bash
brew install tea
```
### Generate SSH key (skip if you already have one)
```bash
ssh-keygen -t ed25519 -C "my-device-name"
```
### Configure SSH for Gitea
```bash
mkdir -p ~/.ssh
cat >> ~/.ssh/config << 'EOF'
Host git.idunara.com
Port 222
User git
IdentityFile ~/.ssh/id_ed25519
EOF
chmod 600 ~/.ssh/config
```
### Add your SSH key to Gitea
1. Copy your public key:
```bash
cat ~/.ssh/id_ed25519.pub
```
2. Go to https://git.idunara.com/user/settings/keys
3. Click **Add Key**, paste it, save.
### Log in with tea
```bash
tea login add --name git.idunara.com --url https://git.idunara.com --user emmanuel
```
You will be prompted for your password. This creates a local token.
### Verify
```bash
tea repo ls
```
---
## 2. Create a New Repo
```bash
tea repo create --name my-project --init --private && tea clone emmanuel/my-project
```
Then start working:
```bash
cd my-project
# ... write code ...
git add .
git commit -m "initial commit"
git push
```
---
## 3. Add Gitea to an Existing Repo
From inside your project directory:
```bash
tea repo create --name my-project --private
git remote add origin git@git.idunara.com:emmanuel/my-project.git
git push -u origin main
```
Note: don't use `--init` here since you already have commits.
---
## Shell Helper (optional)
Add this to your `~/.bashrc` or `~/.zshrc`:
```bash
ginit() {
if [ -z "$1" ]; then
echo "Usage: ginit <repo-name> [--existing]"
return 1
fi
if [ "$2" = "--existing" ]; then
tea repo create --name "$1" --private
git remote add origin "git@git.idunara.com:emmanuel/$1.git"
git push -u origin main
else
tea repo create --name "$1" --init --private && tea clone "emmanuel/$1"
cd "$1"
fi
}
```
Usage:
```bash
# New project (creates repo + clones it)
ginit my-project
# Existing project (creates repo + adds remote + pushes)
cd my-existing-project
ginit my-existing-project --existing
```