Reputation: 6121
I'm trying to automate a process of migrating database a bit. I wonder can I sort migration scripts by the order they have been merged into develop branch and then by original commit they have been added if they were merged in one merge commit.
This way the ordering would be automatically correct.
Upvotes: 0
Views: 37
Reputation: 164839
Use --diff-filter=A
to limit only to added files. Then you can format the log to show only files. Here's a good start.
git log --oneline --diff-filter=A --stat <migration dir>
UPDATE: Then you can play with custom --format
to bring it down to just files. Like RomainValeri commented, --name-only --pretty=format:""
.
git log --name-only --pretty=format:"" --diff-filter=A <migration dir>
Upvotes: 1