-
Notifications
You must be signed in to change notification settings - Fork 0
/
script_emma_first
64 lines (41 loc) · 1.07 KB
/
script_emma_first
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
60
61
62
63
64
#! /usr/bin/env bash
# Get Username
echo -n "Please enter your GitHub username [ENTER]: "
read username
# Get Password
echo -n "Please enter your password [ENTER]: "
read password
# Get Folder Name
folder=`basename "$PWD"`
folder_=`echo ${folder// /_}`
# Delete Remote Repository on github.com
curl -u '$username:$password' -X "DELETE" https://api.github.com/repos/$username/$folder_
# Create Remote Repository on gitHub.com
curl -u '$username:$password' https://api.github.com/user/repos -d "{\"name\":\"$folder_\"}"
# Generate Local Git Repository
git init
# Create .gitignore File
echo
"# $folder_ gitignore
# Ignore everything
*
# Now, whitelist anything that's a directory
!*/
# But not these files
!*.R
!*.py
!*.sql
!*.sas
!*.sh
!*.bat
!*.gitignore
!*.md" >> .gitignore
# Ignore files w/ Size > 5M
find . -size +5M | sed 's|^\./||g' | cat >> .gitignore
# Create README.md File
echo "# $folder_" >> README.md
# Push to the Origin from Master
git add .
git commit -m 'first commit'
git remote add origin [email protected]:$username/$folder_.git
git push -u origin master