Skip to content

A convenient way to create a Git repository from Command Line Interface (predates GitHub CLI).

Notifications You must be signed in to change notification settings

brtkwr/GitRepoFromCLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

Installation

Ubuntu

git clone http://www.github.com/brtknr/GitRepoFromCLI
cd GitRepoFromCLI
chmod u+x git-mkrepo
mkdir ~/.local/bin
ln -rs git-mkrepo ~/.local/bin
echo 'export PATH=$PATH:~/.local/bin' >> ~/.bashrc
source ~/.bashrc

macOS

git clone http://www.github.com/brtknr/GitRepoFromCLI
cd GitRepoFromCLI
chmod u+x git-mkrepo
mkdir ~/.local/bin
ln -rs git-mkrepo ~/.local/bin
echo 'export PATH=$PATH:~/.local/bin' >> ~/.bash_profile
source ~/.bash_profile

One time .netrc configuration

Generate a [new access token]:(https://github.com/settings/tokens/new) and run the following to update your .netrc. You can also use your Github password but that is a really bad idea for obvious reasons.

machine api.github.com login USERNAME password TOKEN >> ~/.netrc

Usage

mkdir ~/NewRepositoryFolder
cd ~/NewRepositoryFolder
git mkrepo

Late realisation

Since I wrote this script, I now realise that there is a much more mature alternative over at http://github.com/github/hub which has a command called git create which does almost exactly the same thing. Ah well, I learnt a lot about bash scripting.

About

A convenient way to create a Git repository from Command Line Interface (predates GitHub CLI).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages