File size: 481 Bytes
53a9f04
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

# Get the current commit count
commit_count=$(git rev-list --count HEAD)

# Increment the commit count
next_commit_count=$((commit_count + 1))

# Add all changes
git add .

# Check if a custom message is provided
if [ -z "$1" ]; then
  commit_message="auto commit #$next_commit_count"
else
  commit_message="$1 #$next_commit_count"
fi

# Commit with the message
git commit -m "$commit_message"

# Push the changes
git push

# to run ./git_auto.sh "Your custom message"