git: Undo specific changes in modified postman collection programmatically

I would suggest to write a script, e.g. restore-existing-ids.sh, which would automate restoring the ids in your file on disk.

This would be more straightforward to write than a program which has to simulate an interactive back & forth with git,
and you could still use it in an alias :

add-postman = '! f () { bash restore-existing-ids.sh "$1" && git add "$1"; }; f'

to “clean” such a file before adding it.

note : I implied this script should be a bash script, it can obviously be written in any language (python, ruby, node … whatever floats your boat)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top