You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On newly installed Windows 10 git pull got the error
> git pull
fatal: detected dubious ownership in repository at 'repo_path''repo_path' is owned by:
(inconvertible) (UUID)
but the current user is:
PC-NAME/User (UUID)
To add an exception for this directory, call:
git config --global --add safe.directory repo_path
# fix> takeown /f <path to the repository> /r /d y
> git pull
remote: Enumerating objects: 123, done.
remote: Counting objects: 100% (123/123), done.
remote: Compressing objects: 100% (30/30), done.
...
Pre-push hook - block any pushing into master branch
#!/bin/sh
protected_branch='master'
current_branch=$(git rev-parse --abbrev-ref HEAD)if [ $protected_branch=$current_branch ]
thenecho"`$protected_branch` is protected branch: push is not allowed!"exit 1
fi
Change author name and email for last commit
git commit --amend --author="First Last <[email protected]>" --no-edit
Pre-commit hook
#!/usr/bin/env bashdeclare -a disallowed=("import package""from package import")
git diff --cached --name-status |whileread x file;doif [ "$x"=='D' ];thencontinue;fiforstop_linein"${disallowed[@]}"doif egrep "${stop_line}"$file;thenecho"ERROR: Disallowed expression \"${stop_line}\" in file: ${file}"exit 1
fidonedone||exit$?