Skip to content

A Shell script that git inits, adds, commits when run

Notifications You must be signed in to change notification settings

Zeyu-Li/Git_initer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Git Initer

This Shell Script command inits, adds, and commits the current directory given a first commit message

Use

To use, simple put:

bash cmt.sh #some commit message

OR

bash cmt #some commit message

OR

./cmt.sh

Code:

#!/bin/bash

# gets args
commit_message="$1"

# checks if null, if so, message will be: "first init"
# else, message will be arg passed in
if [[ ! $commit_message ]]
then
    message="first init"
else
    message=$commit_message
fi

(git init && git add . && git commit -m \""$message"\")

About

A Shell script that git inits, adds, commits when run

Topics

Resources

Stars

Watchers

Forks

Languages