5.1 KiB
5.1 KiB
🦊 Gitea Setup Guide
Complete guide to push your LemonLink project to your Gitea instance.
📋 What I Need From You
To help you set up the repository, please provide:
- Gitea URL - e.g.,
https://git.yourdomain.comorhttps://gitea.lemonlink.eu - Your username - e.g.,
lemonadmin - Repository name - e.g.,
lemonlink-websiteorlanding-page - Access method: SSH key or HTTPS with token?
🚀 Method 1: Create Repo via Web UI (Easiest)
Step 1: Create Repository in Gitea
- Log into your Gitea:
https://your-gitea.com - Click + → New Repository
- Fill in:
- Owner: Your username/organization
- Repository Name:
lemonlink(or your preference) - Description: "Jaw-dropping landing page for my homelab"
- Visibility: ☑️ Make it private (or public if you want)
- Initialize: ☐ Uncheck "Initialize Repository" (we'll push existing files)
- Click Create Repository
Step 2: Push Your Code
Open terminal/command prompt in your project folder and run:
# Initialize Git (if not already done)
git init
# Add all files
git add .
# First commit
git commit -m "Initial commit: Jaw-dropping landing page 🍋"
# Add Gitea remote (replace with your info)
git remote add origin https://your-gitea.com/username/lemonlink.git
# Push to Gitea
git push -u origin main
🔐 Method 2: Using SSH Keys
Step 1: Generate SSH Key (if you don't have one)
# Generate key
ssh-keygen -t ed25519 -C "your-email@example.com"
# Copy public key
cat ~/.ssh/id_ed25519.pub
Step 2: Add Key to Gitea
- Gitea → User Settings → SSH / GPG Keys
- Click Add SSH Key
- Paste your public key
- Click Add Key
Step 3: Push with SSH
# Use SSH URL
git remote add origin git@your-gitea.com:username/lemonlink.git
git push -u origin main
🔑 Method 3: Using HTTPS with Access Token
Step 1: Create Access Token
- Gitea → User Settings → Applications
- Generate New Token
- Name: "LemonLink Development"
- Permissions: ☑️ repo (full access)
- Click Generate Token
- COPY THE TOKEN (you can't see it again!)
Step 2: Push with Token
# Use token in URL (replace YOUR_TOKEN)
git remote add origin https://YOUR_TOKEN@your-gitea.com/username/lemonlink.git
git push -u origin main
Or use credential helper:
git config --global credential.helper cache
git push -u origin main
# Enter username and token as password
🔄 Keeping Gitea in Sync
After making changes:
# Stage changes
git add .
# Commit
git commit -m "Description of changes"
# Push to Gitea
git push origin main
🏷️ Tagging Releases
# Create version tag
git tag -a v1.0.0 -m "First stable release"
# Push tags
git push origin --tags
🎨 Gitea Features to Enable
In your Gitea repository settings:
Issues
- Enable for bug reports and feature requests
Wiki
- Enable for extended documentation
Projects
- Enable for Kanban-style project management
Actions (CI/CD)
If your Gitea has Actions enabled, you can add .gitea/workflows/deploy.yml:
name: Deploy to Server
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy to server
run: |
# Add your deployment commands here
echo "Deployed!"
📱 Cloning on Other Machines
Once in Gitea, clone anywhere:
# HTTPS
git clone https://your-gitea.com/username/lemonlink.git
# SSH
git clone git@your-gitea.com:username/lemonlink.git
🌐 Gitea + Docker Integration
If your Gitea and Docker are on the same VM, you can automate deployment:
Option 1: Gitea Webhook
- Gitea → Repository Settings → Webhooks
- Add Gitea Webhook
- Target URL:
http://localhost:9000/hooks/deploy(your deployment endpoint) - Trigger on: Push events
Option 2: Git Pull in Container
# SSH into Docker VM
cd /opt/lemonlink
git pull origin main
# Files update instantly!
Option 3: Watchtower (Auto-update)
If using Docker image from Gitea Registry:
version: '3.8'
services:
watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 30 --cleanup
🛠️ Troubleshooting
"Permission denied"
# Check remote URL
git remote -v
# Fix permissions on SSH key
chmod 600 ~/.ssh/id_ed25519
"Repository not found"
- Verify repository exists in Gitea
- Check username/repo name spelling
- Ensure you have access permissions
"Failed to push"
# Force push (careful!)
git push -f origin main
# Or pull first
git pull origin main
git push origin main
✨ Quick Reference
| Command | Description |
|---|---|
git status |
Check current state |
git add . |
Stage all changes |
git commit -m "msg" |
Commit changes |
git push |
Push to Gitea |
git pull |
Get latest changes |
git log |
View commit history |
Ready? Give me your Gitea details and I'll generate the exact commands for you! 🚀