Skip to content

Commit

Permalink
upgrade alias
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfogre authored Feb 1, 2019
1 parent 3f0ce7d commit d52e3dd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
1. get a new command "git text"

```bash
git config --global alias.text '!gi() { curl -sSL https://raw.githubusercontent.com/wolfogre/git-text/master/pre-commit -o .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit ; }; gi'
git config --global alias.text '!f() { set -ex ; hookfile=$(git rev-parse --show-toplevel)/.git/hooks/pre-commit ; curl -sSL https://raw.githubusercontent.com/wolfogre/git-text/master/pre-commit -o $hookfile ; chmod +x $hookfile ; }; f'
```

2. install hook for a git repo
Expand All @@ -26,7 +26,7 @@ When you run `get text`, it will download a git hook to `.git/hooks/pre-commit`,
1. get git-text

```text
$ git config --global alias.text '!gi() { curl -sSL https://raw.githubusercontent.com/wolfogre/git-text/master/pre-commit -o .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit ; }; gi'
$ git config --global alias.text '!f() { set -ex ; hookfile=$(git rev-parse --show-toplevel)/.git/hooks/pre-commit ; curl -sSL https://raw.githubusercontent.com/wolfogre/git-text/master/pre-commit -o $hookfile ; chmod +x $hookfile ; }; f'
```

2. create a new repo to test
Expand All @@ -42,8 +42,10 @@ Initialized empty Git repository in /root/test-repo/.git/

```text
$ git text
$ ls -l .git/hooks/pre-commit
-rwxr-xr-x. 1 root root 486 Jan 31 16:41 .git/hooks/pre-commit
++ git rev-parse --show-toplevel
+ hookfile=/root/test-repo/.git/hooks/pre-commit
+ curl -sSL https://raw.githubusercontent.com/wolfogre/git-text/master/pre-commit -o /root/test-repo/.git/hooks/pre-commit
+ chmod +x /root/test-repo/.git/hooks/pre-commit
```

4. test committing text files
Expand Down

0 comments on commit d52e3dd

Please sign in to comment.