Getting started with Git Alias

Using git alias, you can add an alias that adds all files in the folder, commit, and pushes it in one command.

Make script for the Alias

First, make a folder for your scripts

makedir ~/scripts

Make a script for the git command

cd ~/scrips
vim gitacp.sh

Put the shell script in the file and save:

#!/bin/bash
git add .
git commit -m "$1"
git push

Make it executable

sudo chmod +x gitacp.sh

Now you can add the script to .gitconfig

vim ~/.gitconfig
[alias]
        acp = "!/home/USERNAME/scripts/gitacp.sh"

In the gitconfig file, you can add other commands, for adding simple aliases, you can use the built-in git alias command.

git config --global alias.all "add ."

This will make the command git all add everyting in the folder
You can see some more examples of git aliases on the git page https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases

Even shorter commands with zsh

You can even shorten the command more by using the zsh shell and git plugin.

Now you can add all, commit and push in one command.