Skip to content

Commit 88ecf72

Browse files
committed
create ps1 of hooks install
1 parent cf4f00a commit 88ecf72

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

git-client-config.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ if( $GIT_GLOBAL -eq "--global" ) {
1717
echo "******** Creating local ../.git/config file using git config commands"
1818
}
1919

20-
21-
# TODO: Create separate shell file to define git aliases for repo.
22-
# Verify settings:
20+
# Verify settings:
2321
git config $GIT_GLOBAL core.filemode false
2422

2523
# Using variables built into PowerShell: See https://help.github.com/articles/dealing-with-line-endings/
@@ -48,6 +46,9 @@ if ( $IsOSX -eq $True){
4846
if ( $IsOSX -eq $True){
4947
git config $GIT_GLOBAL core.editor "~/Sublime\ Text\ 3/sublime_text -w"
5048
#git config $GIT_GLOBAL core.editor=subl -w
49+
50+
# On Unix systems, ignore ^M symbols created by Windows:
51+
git config core.whitespace cr-at-eol
5152
}
5253

5354
# Allow all Git commands to use colored output, if possible:

git-hooks-install.ps1

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# git-hooks-install.ps1
2+
# by wilsonmar at gmail.com
3+
# After the repo is cloned, this PowerShell script copies
4+
# scripts in the repo's hooks folder into the .git/hooks
5+
# and sets permissions.
6+
7+
echo "Remove *.sample files in .git/hooks ..."
8+
Remove-Item .git/hooks/*.sample
9+
10+
echo "Copy hooks/git-commit into .git/hooks ..."
11+
12+
Copy-Item hooks/prepare-commit-msg .git/hooks
13+
#Copy-Item hooks/git-commit .git/hooks
14+
Copy-Item hooks/git-push .git/hooks
15+
Copy-Item hooks/git-rebase .git/hooks
16+
17+
if( $IsWindows -eq $True ) {
18+
# icacls
19+
}
20+
if ( $IsOSX -eq $True){
21+
chmod +x .git/hooks/prepare-commit-msg
22+
#chmod +x .git/hooks/git-commit
23+
chmod +x .git/hooks/git-push
24+
chmod +x .git/hooks/git-rebase
25+
}
26+
27+
ls .git/hooks
28+
29+
# echo "Done with status $? (0=OK)."

0 commit comments

Comments
 (0)