Linux: Git Add .sh Script

CodeEshop
Nov 1, 2021

--

Bored of writing the same line of code over and over again to commit then try out the below method for Linux to make it easier to commit.
Git Add, commit and push all in one Linux script

  1. Create a new file “gitadd.sh”.
    ( mine is under git folder, Full path with file : ~/git/gitadd.sh )
  2. Copy the code below in the file “gitadd.sh

3. Change the default branch name to your’s so you don’t have to change branch too

name=${name:-“your_default_branch_name”}

3. Run the script

OR for shortning the command

3. Create your alias in file “.bashrc”

Replace the path of file where you place your file from “~git/gitadd.sh” to “your path”

Run the new command

--

--

CodeEshop
CodeEshop

Written by CodeEshop

CodeEshop is Add-on for your need and helps enterprises to grow easily with a large range of ready to use and highly customisable eCommerce products.

No responses yet