Skip to content

Instantly share code, notes, and snippets.

@jasonleonhard
Created June 24, 2015 23:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonleonhard/4a7eaf639f376e076bea to your computer and use it in GitHub Desktop.
Save jasonleonhard/4a7eaf639f376e076bea to your computer and use it in GitHub Desktop.
CREATE A NEW REPO IN GITHUB OR BITBUCKET QUICKLY
NewRepo(){ # NewRepo RepoName5 ~/RepoLocalPath5/ g or # NewRepo Repo1 ~/RepoLocal1/ b
mkdir $2 ;
cd $2 ;
echo $1 | pbcopy ;
echo "$1 $2 $3 un5t0ppab13" >> $3.txt ; # create new file$3 with text"$1$2$3"
if [ -a "g.txt" ] ; then
open 'https://github.com/new/' ;
elif [ -a "b.txt" ] ; then
open 'https://bitbucket.org/repo/create' ;
fi ;
read -p "(signin if req.)
name your new repo the same as its root folder
choose the language
click private
click create repository
then click enter
and return to terminal" ;
git init ;
if [ -a "g.txt" ] ; then
git remote add origin https://github.com/un5t0ppab13/$1.git | pbcopy | pbpaste ; # suggested https
elif [ -a "b.txt" ] ; then
git remote add origin git@bitbucket.org:un5t0ppab13/$1.git | pbcopy | pbpaste ; # suggested ssh
fi ;
ls ;
git add . ;
git add -A ;
git commit -m "1st" ;
git push origin master ;
echo 'if anything goes wrong use:
delete the repo in the browser
BB
open https://bitbucket.org/un5t0ppab13/$1/delete
paste link in to delete
GH
https://github.com/un5t0ppab13/$1/settings
type name to delete
delete local
rm -rf $2 # or rm -rf .git
and try again' ;
git status ;
echo 'refresh browser to see if repo is ready ctrl-c and start over' ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment