Browse Source

editorconfig added & git script updated

Adem Aytac 5 months ago
parent
commit
37397dbd13
2 changed files with 39 additions and 24 deletions
  1. 9 0
      .editorconfig
  2. 30 24
      bin/s.sh

+ 9 - 0
.editorconfig

@@ -0,0 +1,9 @@
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = false

+ 30 - 24
bin/s.sh

@@ -11,37 +11,43 @@ foldername="$tempFolderName/$(basename $(pwd))"
 previousBranch=$([[ ! -d $tempFolderName ]] && mkdir $tempFolderName; [[ ! -f "$foldername" ]] && touch "$foldername" && echo $branch > "$foldername" || cat "$foldername")
 
 checkout () {
-    echo $branch > $foldername
-    git checkout $1
+  echo $branch > $foldername
+  git checkout $1
 }
 
 create () {
-    git checkout -b $1
+  git checkout -b $1
 }
 
 commit () {
-    git add .
-    git commit -m "$1"
+  git add .
+  git commit -m "$1"
 }
 
 case $1 in
-    commit)
-        commit "$2"
-        ;;
-    pull)
-        git pull
-        ;;
-    push)
-        [[ ! -z "$2" ]] && commit "$2"
-        git push -u $remote $branch
-        ;;
-    create)
-        create $2
-        ;;
-    back)
-        checkout $previousBranch
-        ;;
-    *)
-        [ -z "$1" ] && git status || checkout $1
-        ;;
+  commit)
+    commit "$2"
+    ;;
+  pull)
+    git pull
+    ;;
+  push)
+    [[ ! -z "$2" ]] && commit "$2"
+    git push -u $remote $branch
+    ;;
+  force)
+    git push -f
+    ;;
+  create)
+    create $2
+    ;;
+  back)
+    checkout $previousBranch
+    ;;
+  squash)
+    git rebase -i HEAD~$2
+    ;;
+  *)
+    [ -z "$1" ] && git status || checkout $1
+    ;;
 esac