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
Developer articles
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 }}
Yessi-cmd
Ashare_script
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
Ashare_script
/
push_to_github.sh
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
executable file
·
51 lines (43 loc) · 1.48 KB
main
Breadcrumbs
Ashare_script
/
push_to_github.sh
Copy path
Top
File metadata and controls
Code
Blame
executable file
·
51 lines (43 loc) · 1.48 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
#!/bin/bash
# GitHub 推送脚本
echo "📦 准备推送到 GitHub..."
# 1. 配置 git 用户(如果还没配置)
echo ""
echo "1️⃣ 配置 Git 用户信息"
read -p "请输入你的 GitHub 用户名: " github_username
read -p "请输入你的邮箱: " github_email
git config --global user.name "$github_username"
git config --global user.email "$github_email"
echo "✅ Git 用户配置完成"
# 2. 提交代码
echo ""
echo "2️⃣ 提交代码到本地仓库"
git commit -m "Initial commit: A股行情监控 V2 - 智能评分 + 持仓管理 + Telegram Bot"
echo "✅ 本地提交完成"
# 3. 创建 main 分支
echo ""
echo "3️⃣ 切换到 main 分支"
git branch -M main
echo "✅ 已切换到 main 分支"
# 4. 提示创建 GitHub 仓库
echo ""
echo "4️⃣ 创建 GitHub 仓库"
echo "请在浏览器中访问:"
echo " https://github.com/new"
echo ""
echo "创建仓库时:"
echo " - Repository name: Ashare_script (或你喜欢的名字)"
echo " - Public/Private: 选 Public"
echo " - 不要勾选 'Add a README'"
echo " - 点击 'Create repository'"
echo ""
read -p "创建完成后,输入仓库名(直接回车默认用 Ashare_script): " repo_name
repo_name=${repo_name:-Ashare_script}
# 5. 添加远程仓库并推送
echo ""
echo "5️⃣ 推送到 GitHub"
git remote add origin git@github.com:$github_username/$repo_name.git
git push -u origin main
echo ""
echo "🎉 推送成功!"
echo "仓库地址: https://github.com/$github_username/$repo_name"
You can’t perform that action at this time.