Add git remote configuration script and setup guide

This commit is contained in:
defiQUG
2026-01-26 14:10:48 -08:00
parent 5aca5e2eeb
commit 08c074ce10
2 changed files with 361 additions and 0 deletions

View File

@@ -0,0 +1,246 @@
# Git Setup Guide for Token Lists Push
**Date**: 2026-01-26
**Purpose**: Configure git remote and push token lists
---
## Current Status
**All token lists committed** (3 commits)
**All tags created** (3 tags)
**Git user configured**: defiQUG <defi@defi-oracle.io>
⚠️ **Remote not configured** - needs setup
---
## Quick Setup (Automated)
Run the configuration script:
```bash
cd /home/intlc/projects/proxmox
./token-lists/scripts/configure-git-remote.sh
```
This script will:
1. Check current git configuration
2. Prompt for repository URL
3. Configure remote
4. Test SSH connection (if using SSH)
5. Optionally push commits and tags
---
## Manual Setup
### Step 1: Configure Remote
**Option A: SSH (Recommended)**
```bash
# Add remote (replace with your repository URL)
git remote add origin git@github.com:username/repo-name.git
# Verify
git remote -v
```
**Option B: HTTPS**
```bash
# Add remote (replace with your repository URL)
git remote add origin https://github.com/username/repo-name.git
# Verify
git remote -v
```
### Step 2: Test Connection
**For SSH:**
```bash
ssh -T git@github.com
# Should see: Hi defiQUG! You've successfully authenticated...
```
**For HTTPS:**
- You'll be prompted for credentials when pushing
- Use Personal Access Token as password
### Step 3: Configure Push Settings
```bash
git config push.default simple
git config push.autoSetupRemote true
```
### Step 4: Push Commits and Tags
```bash
# Check current branch
git branch --show-current
# Push commits (replace 'master' with your branch name)
git push -u origin master
# Push tags
git push origin --tags
```
---
## SSH Key Setup (If Needed)
If SSH authentication is not working:
### 1. Check for existing SSH key
```bash
ls -la ~/.ssh/*.pub
```
### 2. Generate new SSH key (if needed)
```bash
ssh-keygen -t ed25519 -C "defi@defi-oracle.io"
# Press Enter to accept default location
# Set a passphrase (optional but recommended)
```
### 3. Add SSH key to GitHub
```bash
# Display public key
cat ~/.ssh/id_ed25519.pub
# Copy the output, then:
# 1. Go to: https://github.com/settings/keys
# 2. Click "New SSH key"
# 3. Paste the public key
# 4. Click "Add SSH key"
```
### 4. Test SSH connection
```bash
ssh -T git@github.com
```
---
## HTTPS Setup (Alternative)
If you prefer HTTPS:
### 1. Create Personal Access Token
1. Go to: https://github.com/settings/tokens
2. Click "Generate new token (classic)"
3. Select `repo` scope
4. Generate and copy the token
### 2. Configure credential helper
```bash
git config --global credential.helper store
```
### 3. Push (will prompt for credentials)
```bash
git push -u origin master
# Username: defiQUG
# Password: <paste-your-token-here>
```
---
## Verify Configuration
After setup, verify everything:
```bash
# Check remote
git remote -v
# Check commits ready to push
git log --oneline origin/master..HEAD
# Check tags ready to push
git tag -l "token-list-*"
# Test push (dry-run)
git push --dry-run origin master
```
---
## Push Commands
Once configured:
```bash
# Push commits
git push -u origin master
# Push tags
git push origin --tags
```
Or use the helper script:
```bash
./token-lists/PUSH_AND_SUBMIT.sh
```
---
## Troubleshooting
### "Permission denied (publickey)"
- SSH key not added to GitHub
- Run: `ssh-add ~/.ssh/id_ed25519`
- Add key to GitHub: https://github.com/settings/keys
### "Repository not found"
- Check repository URL is correct
- Verify you have push access
- Check repository exists on GitHub
### "Updates were rejected"
- Repository has changes you don't have
- Pull first: `git pull origin master --rebase`
- Then push: `git push origin master`
### "No configured push destination"
- Remote not configured
- Run: `./token-lists/scripts/configure-git-remote.sh`
---
## After Push
Once pushed, token lists will be available at:
- **ChainID 138**: `https://raw.githubusercontent.com/{user}/{repo}/main/token-lists/lists/dbis-138.tokenlist.json`
- **Ethereum Mainnet**: `https://raw.githubusercontent.com/{user}/{repo}/main/token-lists/lists/ethereum-mainnet.tokenlist.json`
- **ALL Mainnet**: `https://raw.githubusercontent.com/{user}/{repo}/main/token-lists/lists/all-mainnet.tokenlist.json`
---
## Next Steps
After successful push:
1. ✅ Verify GitHub Raw URLs are accessible
2. ✅ Sign token lists (optional)
3. ✅ Submit to registries (Uniswap, MetaMask, Chainlist)
---
**Last Updated**: 2026-01-26

View File

@@ -0,0 +1,115 @@
#!/usr/bin/env bash
# Configure git remote for token lists push
# This script helps set up the git remote and push configuration
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
log_success() { echo -e "${GREEN}[✓]${NC} $1"; }
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
cd "$REPO_ROOT"
# Check current git config
log_info "Current git configuration:"
echo " User: $(git config user.name)"
echo " Email: $(git config user.email)"
echo ""
# Check if remote exists
if git remote get-url origin &>/dev/null; then
log_success "Remote 'origin' already configured:"
git remote -v
echo ""
read -p "Do you want to change it? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
log_info "Keeping existing remote"
exit 0
fi
git remote remove origin
fi
# Get repository URL
log_info "Please provide your GitHub repository URL"
log_info "Examples:"
echo " HTTPS: https://github.com/username/repo-name.git"
echo " SSH: git@github.com:username/repo-name.git"
echo ""
read -p "Repository URL: " REPO_URL
if [[ -z "$REPO_URL" ]]; then
log_error "Repository URL is required"
exit 1
fi
# Add remote
log_info "Adding remote 'origin'..."
git remote add origin "$REPO_URL"
log_success "Remote configured:"
git remote -v
echo ""
# Check SSH authentication (if using SSH)
if [[ "$REPO_URL" =~ ^git@ ]]; then
log_info "Testing SSH connection to GitHub..."
if ssh -T git@github.com 2>&1 | grep -q "successfully authenticated"; then
log_success "SSH authentication working"
else
log_warn "SSH authentication may not be configured"
log_info "To set up SSH:"
echo " 1. Generate key: ssh-keygen -t ed25519 -C 'your_email@example.com'"
echo " 2. Add to GitHub: https://github.com/settings/keys"
echo " 3. Test: ssh -T git@github.com"
fi
fi
# Set up push configuration
log_info "Configuring git push settings..."
git config push.default simple
git config push.autoSetupRemote true
log_success "Git configuration complete!"
echo ""
# Check current branch
CURRENT_BRANCH=$(git branch --show-current)
log_info "Current branch: $CURRENT_BRANCH"
# Show what will be pushed
log_info "Commits ready to push:"
git log --oneline origin/$CURRENT_BRANCH..HEAD 2>/dev/null || git log --oneline -5
echo ""
log_info "Tags ready to push:"
git tag -l "token-list-*"
echo ""
read -p "Ready to push? (y/N): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
log_info "Pushing commits..."
git push -u origin "$CURRENT_BRANCH"
log_info "Pushing tags..."
git push origin --tags
log_success "✅ Push complete!"
else
log_info "Push cancelled. You can push later with:"
echo " git push -u origin $CURRENT_BRANCH"
echo " git push origin --tags"
fi