Last active
October 27, 2019 08:42
-
-
Save AdryDev92/c2c21cb50498aa6508f7712545b0f426 to your computer and use it in GitHub Desktop.
Self building repo into github with direct connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/zsh | |
# if you use bash, change /bin/zsh to /bin/bash | |
if [ "$1" = "-h" ]; then | |
echo "To use correctly this script, execute: | |
[arg1 = folder name] [arg2 = repo/github/url] | |
./auto-repo [arg1] [arg2]" | |
exit 0 | |
fi | |
mkdir "$1" && cd "$1" && git init && echo "this is a readme" >> README.md | |
&& git add README.md && git commit -m "first commit" | |
&& git remote add origin "$2" && git push origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You only need write the
folder name
and therepo url
.If you want see the script's help, write:
./auto-repo -h
.