Automate git repository initialization on your local machine

Option 1: Existing remote repository

#! /bin/bash/# Initialise a git repo on a local machine 
# Link it to a remote repository on github
# TO run: bash script_name.sh "first commit" inside your working directory
clear
echo "# git-new-repo-bash-script" >> README.md
git init
git add README.md
git commit -m $1
git remote add origin https://github.com/Banzyme/git-new-repo-bash-script.git
git push -u origin master
#! /bin/bash/
# This script will update changes to an existing remote repository
# Run command: bash update.sh "Fist change"
git add .
git commit -m $1
git push -u origin master
#! /bin/bash
# Run: bash local_to_remote.sh
git remote add origin https://github.com/Banzyme/git-new-repo-bash-script.git
git push -u origin master

Written by

Former Glorified Electrician(aka Electrical Engineer). Now a Software Developer working on complex Enterprise Software. Lets connect on twitter @NdamuleloNemakh

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store