Skip to content

Commit 0e0109d

Browse files
committed
Add usage info to readme
1 parent 685eb1c commit 0e0109d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,31 @@ Copy or symlink:
2020

2121
1. `bin/git_rails` into your executable `$PATH`
2222
2. `hooks/*` into your `.git/hooks/`
23+
24+
### Usage
25+
26+
#### Command
27+
28+
After you checkout a branch, if you realize your migrations or gems are messed up from the switch, just run:
29+
30+
`git_rails`
31+
32+
This is the same as running:
33+
34+
`git_rails ORIG_HEAD HEAD`
35+
36+
If you know what ref you are coming from and it isn't `ORIG_HEAD` use:
37+
38+
`git_rails [REF_YOU_JUST_CAME_FROM]`
39+
40+
Or if you really know what you are doing and you want to pretend like you are on a different branch you can do:
41+
42+
`git_rails [REF_YOU_CAME_FROM] [REF_YOU_ARE_GOING_TO]`
43+
44+
Migrations that were added between `REF_YOU_CAME_FROM` and `REF_YOU_ARE_GOING_TO` that do not exist on your current `HEAD` will not be applied because they don't exist!!
45+
46+
#### Hooks
47+
48+
You shouldn't have to think about the hooks once they are installed. Just pull, checkout, and rebase as normal and they should work fine. If you find that `git_rails` hasn't fired when it should follow the command instructions to run it manually.
49+
50+
Also, the hooks are optional, you can use `git_rails` without them!

0 commit comments

Comments
 (0)