Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
af520428
CV
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
CV
/
upload-github.bat
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
59 lines (53 loc) · 1.57 KB
main
Breadcrumbs
CV
/
upload-github.bat
Copy path
Top
File metadata and controls
Code
Blame
59 lines (53 loc) · 1.57 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@echo off
setlocal EnableDelayedExpansion
chcp 65001 >nul
cd /d "%~dp0"
set "GH=C:\Program Files\GitHub CLI\gh.exe"
if not exist "%GH%" set "GH=gh"
echo === PinClipboard 上传到 GitHub ===
echo.
"%GH%" --version >nul 2>&1
if errorlevel 1 (
echo [错误] 未找到 GitHub CLI,请运行: winget install GitHub.cli
pause
exit /b 1
)
"%GH%" auth status >nul 2>&1
if errorlevel 1 (
echo 浏览器登录失败通常是网络无法访问 GitHub。
echo.
echo 请改用 Token 登录:
echo 1. 用 VPN 或手机热点打开 https://github.com/settings/tokens
echo 2. Generate new token ^(classic^) - 勾选 repo 权限
echo 3. 复制 token ^(ghp_ 开头^)
echo 4. 粘贴到下面,回车
echo.
set /p GITHUB_TOKEN=请输入 Token:
if "!GITHUB_TOKEN!"=="" (
echo Token 为空,已取消
pause
exit /b 1
)
echo !GITHUB_TOKEN!| "%GH%" auth login --with-token
if errorlevel 1 (
echo Token 登录失败,请检查 token 是否有效
pause
exit /b 1
)
echo 登录成功!
echo.
)
echo [2/3] 创建仓库并推送...
"%GH%" repo create PinClipboard --public --source=. --remote=origin --push --description "Windows pinned clipboard overlay"
if errorlevel 1 (
echo.
echo 自动创建失败。请手动在 GitHub 网页新建空仓库 PinClipboard,然后执行:
echo git remote add origin https://github.com/你的用户名/PinClipboard.git
echo git push -u origin main
pause
exit /b 1
)
echo.
echo [3/3] 上传成功!
"%GH%" repo view --web
pause
You can’t perform that action at this time.