-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-init.sh
More file actions
executable file
·39 lines (32 loc) · 963 Bytes
/
git-init.sh
File metadata and controls
executable file
·39 lines (32 loc) · 963 Bytes
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
#!/bin/bash
echo "Initializing git repository"
echo "Enter the repository name:"
read repo_name
echo "git init"
git init
echo "git config user.email \"[email protected]\""
git config user.email "[email protected]"
echo "git config user.name \"Fabio dos santos\""
git config user.name "Fabio dos santos"
echo "git remote add origin github-fabio:fabioods/$repo_name.git"
git remote add origin github-fabio:fabioods/$repo_name.git
echo "Repository created"
echo "Would you like to create readme? [y/n]"
read readme_answer
if [[ $readme_answer == 'y' || $readme_answer == 'Y' ]];
then
echo "Creating readme"
npx readme-md-generator
echo "Readme created"
fi
if [ -f "./README.md" ]; then
echo "Creating commit to readme"
git add README.md
echo "Creating commit to readme"
git commit -m "doc: add readme" --no-verify
echo "Pushing readme to github"
git push -u origin main
echo "Pushed to github"
fi
echo "Opening repository in VsCode"
code .