1

I would like to be able to review and reject part of changes made by other developer.

Let's say that i know that other developer made some changes and pushed them to public repository.

I also know that some of them are wrong and some are correct.

When i do git pull - git merge all the changes.

Is there any way to walk through all the comming changes and accept them or reject?

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • 1
    Waiting for experts, I would say: 1) fetch the remote repository, say the HEAD is at A. 2) Make a branch from your local HEAD, say B. 3) rebase A onto B interactively, editing the commit with changes you want to select. 4) Merge the new local head into A (or rewrite the public history if everyone agree) . – Margaret Bloom Feb 18 '16 at 09:07
  • 1
    In console: run `git pull --no-commit`, then `git commit --interactive`, which will allow you to drop the incoming changes selectively. – max630 Feb 19 '16 at 21:37
  • In GUI: run `git gui` after `git pull` and select "Amend Last Commit". – max630 Feb 19 '16 at 21:37

1 Answers1

0

Is there any way to walk through all the comming changes and accept them or reject?

Yes you can do it using hooks.

Read this answer on how to do it and use a similar code but for your purpose.
What are some more forceful ways than a .gitignore to keep (force) files out of a repo?

Community
  • 1
  • 1
CodeWizard
  • 128,036
  • 21
  • 144
  • 167