blob: 79e750f11d6609da77179dbf7a8d418ac7b2eba0 (
plain) (
blame)
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
|
#!/bin/bash
read -p "Local repo name: " local_name
read -p "Remote repo name: " remote_name
# 远程仓库创建
tmp="ssh aliyun-git git init --bare $remote_name.git"
eval "$tmp"
# 本地仓库创建
mkdir "$local_name"
cd "$local_name"
git init
# 本地仓库初始化
# 编写.gitignore
cat > .gitignore << EOF
*.sh
*.bat
*.exe
*.[oa]
*.pyc
__pycache__
*.vscode
*.swp
EOF
# 编写push.sh
cat > push.sh << EOF
git add .
git commit
git push
EOF
chmod +x push.sh
# 提交初始化commit
git add .
git commit -m "Initial commit"
tmp="git remote add origin aliyun-git:$remote_name.git"
eval "$tmp"
git push --set-upstream origin master
git push
echo "Success!"
|