Skip to content

Instantly share code, notes, and snippets.

@AdryDev92
Last active October 27, 2019 08:42
Show Gist options
  • Save AdryDev92/c2c21cb50498aa6508f7712545b0f426 to your computer and use it in GitHub Desktop.
Save AdryDev92/c2c21cb50498aa6508f7712545b0f426 to your computer and use it in GitHub Desktop.
Self building repo into github with direct connection
#! /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
@AdryDev92
Copy link
Author

You only need write the folder name and the repo url.
If you want see the script's help, write: ./auto-repo -h.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment