Loading...
Loading...
Push projects to GitHub with three automatically determined modes: **First-time Push** (large file scanning → generate .gitignore → git init → create repo via gh → push), **Daily Update** (commit + push), **Version Release** (tag + create Release, optional attached download files). Core principle: Safety First: Must scan for large files and sensitive files before pushing, better to ask one more question than push something that shouldn't be pushed. Triggered when users say "push to GitHub", "git push", "upload to GitHub", "commit and push", "release version", "create release", "create tag", "/git-push". Not applicable for: Planning which features go into which version number (use issue-pool—this skill only handles tagging pre-determined version numbers), complex git operations like rebase/cherry-pick/resolving conflicts/modifying history/rolling back (use git commands directly, this skill does not cover these), self-testing and acceptance before code is completed.
npx skill4agent add yunshu0909/yunshu_skillshub git-pushbrew install gitbrew install ghgh auth statusgh auth logingit config user.namegit config user.emailgit config --global user.name "Your Name"
git config --global user.email "your.email@example.com"Not a git repository → [First-time Push] Start from Step 1
Is a git repository, no remote → "Local git exists but not linked to remote"
→ First perform large file scanning in Step 1 (ensure safety)
→ Then jump to Step 2 to link remote
Is a git repository, has remote → [Existing Repository] Enter mode selection:
├── "Push daily update" → Jump to Step 3B (Daily Update)
├── "Release new version" → Check for uncommitted changes
│ ├── Has changes → First go through Step 3B, then Step 4
│ └── No changes → Directly jump to Step 4 (only create tag + Release)
└── "Restart"
→ ⚠️ Warning: "This will delete all Git history (including all commits, branches, tags), which cannot be recovered."
→ Delete .git after user's second confirmation, start from Step 1⚠️ Iron Rule: .gitignore must be in place before the first. Never commit first then exclude—large files in Git history cannot be fully deleted, leading to bloated repositories and push failures.git add
du -sh| Size | Handling Method |
|---|---|
| >10MB | List them, ask user one by one "Do you want to push this?" |
| >50MB | Additional warning "This is large, pushing will be slow" |
| Single file >100MB | Must exclude, GitHub hard limit, cannot be pushed |
Scanned content exceeding 10MB:
1. 109MB slides/ (PPT + large images)
2. 12MB assets/ (video files)
⚠️ slides/ exceeds 50MB, pushing will be slow.
❌ recording.mp4 (150MB) exceeds GitHub's 100MB single file limit, must be excluded.
Which ones to exclude? (Enter serial numbers, or "exclude all" / "keep all").env.env.**secret**credential**token**.pem*.keymemory/MEMORY.md# macOS
.DS_Store
.AppleDouble
.LSOverride
._*
# Editor
*.swp
*.swo
*~
.vscode/
.idea/
# [Dynamically generated based on scanning results below]
# Large files (confirmed to exclude by user)
[Path1]
[Path2]
# Sensitive content (only for public repositories)
[Path3]gh repo view [account]/[repo-name]1. git init + git branch -m main
2. git add -A
3. git commit -m "init: Initialize [repo-name]"
4. Create remote repository (if repository does not exist in Step 2):
gh repo create [repo-name] --private/--public --description "[description]" --source=. --remote=origin
(If user selected "use existing repository" in Step 2, skip creation, directly: git remote add origin [existing repo URL])
5. git push -u origin main1. Scan changes: git status to check what was modified
2. Check newly added large files:
- New files >10MB → Ask user for confirmation
- Single new file >100MB → Must exclude, add to .gitignore
- If .gitignore is modified, ensure .gitignore itself is included in subsequent git add
3. git add -A
4. git commit -m "[Automatically generate commit message based on changes]"
- Commit message rule: Concise, one sentence summarizing main changes
- Example: "update: Add user module + fix login bug"
5. git push| Error | Cause | Handling |
|---|---|---|
| Remote has commits not present locally | Default to execute |
| Still failed / Remote conflicts | Incompatible history | Ask user "Force overwrite remote?" ⚠️ Inform: "This will overwrite all remote content, only use if you confirm remote content can be discarded"→ |
| Timeout / Stuck | Network or repository too large | Check repository size, suggest excluding large files then retry |
| Authentication failed | Token expired | Prompt |
| Single file exceeds limit | Prompt specific file name, add to .gitignore, re-commit and push |
| File exception / Missing configuration | Display error message, guide user to troubleshoot |
Read existing tags (git tag --sort=-v:refname | head -5)
├── No tags → Suggest v0.1.0
└── Has tags → Show latest version, suggest next one (default minor +1)
- v0.1.0 → Suggest v0.2.0
- v1.2.3 → Suggest v1.3.0
- User can customize any version number
Version Number Explanation (for user reference):
- v0.1.0 → v0.2.0 Minor update (added features, modified content)
- v0.2.0 → v1.0.0 Major milestone (first official release, major refactoring)
- v1.0.0 → v1.0.1 Bug fixes (fixed a bug)git log [last tag]..HEAD --onelineNeed to attach downloadable files? (e.g., App installation package, tool zip package, etc.)
├── No → Only create tag + Release page
└── Yes → User provides file path
└── Check if file exists → Prompt re-entry if not existsgit tag [version]
git push origin [version]
gh release create [version] --title "[repo-name] [version]" --notes "[Release Notes]"
# If there are attachments:
gh release upload [version] [file path]✅ Push completed!
- Repository: [URL]
- Visibility: Private / Public
- Number of files: [N]
- Repository size: [X]
- Exclusions: [List content excluded by .gitignore]
- Release: [Version number + URL] / Not createdgit addUser: Help me push to GitHub
Skill:
→ Check environment: git ✅ gh ✅ Logged in ✅ git user configured ✅ Not a git repository
→ Scan project...Found content exceeding 10MB:
- 85MB slides/ → User confirms exclusion
- 15MB images/ → User confirms retention
→ Generate .gitignore, user confirms
→ Repository name: my-project, private
→ Initialize + push successfully
→ "Need to create a Release?" → Skip
→ ✅ CompletedUser: Push it
Skill:
→ Detected linked remote repository
→ Scan changes: Modified 3 files, added 2 files (all <10MB)
→ Commit message: "update: Add user module + update configuration file"
→ Push successfully
→ ✅ CompletedUser: Create a release
Skill:
→ Current latest tag: v0.1.0
→ "Suggest next version v0.2.0, okay?"
→ Automatically generate change summary (based on commit records)
→ "Need to attach download files?" → No
→ Create tag + Release
→ ✅ Release v0.2.0 created successfully!→ git push failed: file recording.mp4 exceeds 100MB
→ "recording.mp4 (150MB) exceeds GitHub's limit, needs to be excluded"
→ Add to .gitignore, re-commit and push
→ ✅ SuccessUser: Push it
→ Scan changes...Found new file:
- demo.pptx (25MB)
→ "This file is 25MB, confirm to push?"
→ User confirms exclusion → Add to .gitignore
→ Push successfully
→ ✅ CompletedUser: Create a release
→ No uncommitted changes currently, directly enter version release
→ Current latest tag: v0.2.0
→ "Suggest v0.3.0, okay?"
→ User customizes input v1.0.0
→ Generate change summary + create Release
→ ✅ Release v1.0.0 created successfully!