Added git-utils

This commit is contained in:
2022-08-12 00:24:41 +09:00
parent b10b68aa3b
commit b420add084
3 changed files with 48 additions and 12 deletions

View File

@@ -1,17 +1,9 @@
#!/bin/bash
function git-config-as {
local SHA NAME EMAIL
SHA=$1
if [ -z "$1" ]; then
SHA=HEAD
fi
NAME=$( git log $SHA -1 --pretty=format:%aN )
EMAIL=$( git log $SHA -1 --pretty=format:%ae )
git config user.name "$NAME"
git config user.email "$EMAIL"
echo "Configured as \"$NAME <$EMAIL>\""
function sanitize-perms {
chown $USER.$USER . -R
find . -type d -exec chmod 755 {}\;
find . -type f -exec chmod 644 {}\;
}
# Kubernetes