dotfiles/scripts/git-init
2015-02-19 20:02:27 +01:00

26 lines
488 B
Bash
Executable File

#!/bin/bash
# Help function
function show_help {
echo "Usage: git-init <url>";
}
# Checking if url is specified
if [ -z "$1" ]; then show_help; exit 0; fi;
# Making README.md
touch README.md
echo "#$(basename $PWD)" >> README.md
# Make .gitignore
touch .gitignore
printf "*~\n*.swp" >> .gitignore
# Initializing git and making first commit
git init
git add .
git commit -m "Initial commit"
# Set origin and push the first commit
git remote add origin $1;
git push -u origin master;