-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload_when_network_fixed.sh
More file actions
41 lines (34 loc) · 1.1 KB
/
upload_when_network_fixed.sh
File metadata and controls
41 lines (34 loc) · 1.1 KB
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
#!/bin/bash
echo "网络问题解决后的GitHub上传脚本"
echo "================================"
cd /mnt/c/Users/HW/Desktop/yuanhechen/DataProcessing
# 重新设置原始GitHub地址
git remote set-url origin https://github.com/18621098785/DataProcessing.git
echo "当前远程仓库配置:"
git remote -v
echo ""
echo "测试GitHub连接..."
if ping -c 1 github.com > /dev/null 2>&1; then
echo "✅ GitHub连接正常"
echo "正在推送代码..."
git push -u origin main
if [ $? -eq 0 ]; then
echo ""
echo "🎉 成功!项目已上传到GitHub"
echo "项目地址: https://github.com/18621098785/DataProcessing"
else
echo ""
echo "❌ 推送失败,可能需要身份验证"
echo "请尝试:"
echo "1. 在GitHub设置Personal Access Token"
echo "2. 使用token作为密码"
fi
else
echo "❌ GitHub连接失败"
echo "请检查:"
echo "1. 网络连接"
echo "2. 是否需要代理"
echo "3. DNS设置"
echo ""
echo "或使用手动上传方式:参考 GITHUB_UPLOAD_GUIDE.md"
fi