name: github-push description: >- Push a local project to GitHub from Windows + China network environment. Use whenever the user mentions pushing, uploading, or putting code on GitHub — especially from Windows or behind GFW/proxy. compatibility: git >=2.40, ssh, clash-verge or v2ray environment: os: Windows 11 Home China 10.0.26100 shell: Git Bash (mingw64) network: "GFW-restricted — GitHub blocked, requires proxy at 127.0.0.1:7890" tools: git 2.47, ssh, Clash Verge
Push a local project to GitHub from Windows + China network environment
| Key | Value |
|---|---|
| OS | Windows 11 Home China 10.0.26100 |
| Shell | Git Bash (mingw64) |
| Network | GFW-restricted — GitHub blocked, requires proxy at 127.0.0.1:7890 |
| Tools | git 2.47, ssh, Clash Verge |
Why this matters: GitHub is blocked by GFW; git push/pull time out without a proxy. HTTPS triggers Windows credential manager popups that break non-interactive use. Without this context, the agent will assume a standard Linux/macOS environment and fail with the same dead ends this skill documents.
This skill activates when the user asks to:
- push to GitHub
- upload this project to GitHub
- create a GitHub repo for this
- put this on GitHub
- push my code to GitHub
The trigger phrases above cover how real users talk — from formal to casual. If a phrase feels unnatural, rewrite it to match how you actually speak.
The most common use case distilled to the minimal path:
git config --global http.proxy http://127.0.0.1:7890 && git config --global https.proxy http://127.0.0.1:7890
git remote add origin git@github.com:USERNAME/REPO.git
git push -u origin mainReplace USERNAME/REPO with your actual repo. Ensure SSH key is added to GitHub first.
Steps verified in this environment. Every command below was actually run and succeeded.
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890Without proxy config, git push hangs or times out because GitHub is blocked by GFW. The proxy tunnels traffic through Clash Verge or v2ray.
git remote add origin git@github.com:USERNAME/REPO.gitHTTPS triggers Windows credential manager popups and often returns 403. SSH with key auth goes through the proxy cleanly. Ensure ~/.ssh/config has ProxyCommand configured for github.com.
git push -u origin mainGit Bash on Windows may misinterpret the default branch; explicit -u origin main avoids this. New repos default to 'main', not 'master'.
Before this skill existed, each session would independently:
- Try
git pushwithout proxy config → fail - Try HTTPS remote +
gh auth login→ fail - Eventually rediscover the winning path
Now the agent loads this skill and jumps straight to the proven approach. No rediscovery needed.
These were tried and failed in this environment. Each one cost real time.
| Dead end | Environment cause | What happened |
|---|---|---|
git push without proxy config |
GitHub is blocked by GFW at the network level | Connection times out after 60s; 'fatal: unable to access' |
HTTPS remote + gh auth login |
Browser OAuth flow blocked by proxy; Windows credential manager intercepts auth | Endless popup loop or 403 forbidden even after 'successful' login |
git push origin master |
New repos default branch is 'main', not 'master' | 'src refspec master does not match any' — branch doesn't exist |
Confirm success with:
git ls-remote --heads originExpected output: Lists remote branches without error, showing refs/heads/main
- If proxy address differs (v2ray uses 10809, others may vary), update config accordingly
- If SSH key not set up:
ssh-keygen -t ed25519 -C "your@email.com"then add to GitHub Settings → SSH Keys - The
connecttool for ProxyCommand comes with Git Bash; if missing, installmingw-w64-x86_64-connectvia pacman
- GitHub docs: Connecting to GitHub with SSH
- Clash Verge docs