- Copy actual .gitconfig instead of placeholder - Create encrypted SSH key backup script with GPG - Add SSH-based remote setup script - Include restore instructions and security notes 🤖 Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
61 lines
1.8 KiB
Bash
Executable File
61 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Setup GitHub and Gitea remotes for dotfiles repository
|
|
|
|
set -euo pipefail
|
|
|
|
# Colors
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m'
|
|
|
|
echo -e "${BLUE}Setting up Git remotes for dotfiles repository${NC}"
|
|
echo "=============================================="
|
|
|
|
cd ~/dotfiles
|
|
|
|
# Check if we have gh CLI
|
|
if ! command -v gh >/dev/null 2>&1; then
|
|
echo -e "${YELLOW}GitHub CLI (gh) not found. Please install it first: brew install gh${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if logged into GitHub
|
|
if ! gh auth status >/dev/null 2>&1; then
|
|
echo -e "${YELLOW}Please login to GitHub first: gh auth login${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
echo -e "${YELLOW}Creating GitHub repository...${NC}"
|
|
|
|
# Create GitHub repository
|
|
gh repo create dotfiles --public --description "🖖 Complete macOS dotfiles system - From zero to fully configured in minutes. 'Engage!'" --homepage ""
|
|
|
|
# Add GitHub remote
|
|
git remote add github https://github.com/$(gh api user --jq .login)/dotfiles.git
|
|
|
|
echo -e "${GREEN}✓ GitHub repository created${NC}"
|
|
|
|
# Push to GitHub
|
|
echo -e "${YELLOW}Pushing to GitHub...${NC}"
|
|
git push -u github master
|
|
|
|
echo -e "${GREEN}✓ Pushed to GitHub${NC}"
|
|
|
|
echo ""
|
|
echo -e "${BLUE}Gitea Setup${NC}"
|
|
echo "For Gitea, you'll need to:"
|
|
echo "1. Create repository manually on your Gitea instance"
|
|
echo "2. Add the remote:"
|
|
echo " git remote add gitea https://your-gitea-instance.com/username/dotfiles.git"
|
|
echo "3. Push to Gitea:"
|
|
echo " git push -u gitea master"
|
|
|
|
echo ""
|
|
echo -e "${GREEN}Setup complete! 🎉${NC}"
|
|
echo ""
|
|
echo "Repository URLs:"
|
|
echo "• GitHub: https://github.com/$(gh api user --jq .login)/dotfiles"
|
|
echo "• Clone command: git clone https://github.com/$(gh api user --jq .login)/dotfiles.git ~/dotfiles && ~/dotfiles/engage"
|
|
echo ""
|
|
echo -e "${BLUE}Your 'engage' command is ready for the world! 🖖${NC}" |