void (@NotNull GitRepository repository, @NotNull String branch, @NotNull Collection<String> fileNames) { cd(repository); for (String it : fileNames) { echo(it, LOCAL_CHANGES_OVERWRITTEN_BY.initial); git(repository, "add " + it); } git(repository, "commit -m initial_changes"); git(repository, "checkout -b " + branch); for (String it : fileNames) { prepend(it, LOCAL_CHANGES_OVERWRITTEN_BY.branchLine); git(repository, "add " + it); } git(repository, "commit -m branch_changes"); git(repository, "checkout master"); for (String it : fileNames) { echo(it, LOCAL_CHANGES_OVERWRITTEN_BY.masterLine); } }