Skip to content

Instantly share code, notes, and snippets.

@adini121
Last active October 3, 2015 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adini121/b766f9a65b258452d8da to your computer and use it in GitHub Desktop.
Save adini121/b766f9a65b258452d8da to your computer and use it in GitHub Desktop.
Create a new repository locally AND add remote too (e.g. create a remote repository at github from local one)
#! /bin/bash
# Description
# Author: Adi
# ChangeLog:
# Date: 29.08.15
repo=$1
git init
git add .
git commit -m 'First commit'
curl -u 'adini121' https://api.github.com/user/repos -d '{"name":"'$repo'"}'
git remote add origin git@github.com:adini121/'$repo'.git
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment