aboutsummaryrefslogtreecommitdiff
path: root/commit.sh
diff options
context:
space:
mode:
Diffstat (limited to 'commit.sh')
-rwxr-xr-xcommit.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/commit.sh b/commit.sh
index 4d87cd6..c3dda02 100755
--- a/commit.sh
+++ b/commit.sh
@@ -57,13 +57,15 @@ commit() {
then
msg="$3: $2"
# If the branch is the current branch, commit the files
- git commit $1 -m "$msg"
+ git add $1
+ git commit -m "$msg"
git push origin $branch
else
# If the branch is not the current branch, checkout the branch and commit the files
git checkout $branch
msg="$3: $2"
- git commit $1 -m "$msg"
+ git add $1
+ git commit -m "$msg"
git push origin $branch
fi
}