On Wed, May 27, 2020 at 06:43:54PM +0530, Kunal Chauhan wrote:

> If changes has done on repo1 at barnch.x
> 
> And same changes need to incorporate in branch of other repo.
> 
> Is git diff may helpful ?

Depends on what you put into this.
It's of course helpful to oversee the changes made.
But it's not too helpful if these changes span more than a single
commit, and even less so if parts of these changes were contributed by
merge commits.

> What apporach to flow?

There are many, and which one to use should be judged on a case-by-case
basis.

Basically there are two ways to bring changes made on a branch onto
another:

 * Merge the "source" branch into the "destination" branch.

   One has to keep in mind that this brings _all_ the changes from the
   source branch into the destination branch since the time of their
   last merge (or since the beginning of time, if there were no merges).

   The command to look at is `git merge`.

 * Cherry-picking allows applying individual commits from the source
   branch to the destination branch.

   Note that this transfer _textual_ changes, and the fact you have
   transferred some changes from one branch to another is not recorded
   in any way as it is in the case of merge, which creates a special
   commit.

   The command to look at is `git cherry-pick`.

There exist other, albeit more weird, possibilities. For instance, you
really may save an output of `git diff` and then apply it as a textual
patch on the destination branch using the `git apply` or `git am`
commands, but in general when you think of this approach it's a sign you
want cherry-picking - unless you really understand what you're about to
do, in which case you'd not be asking your question in the first place.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20200528125942.57efumu4jrvkm24p%40carbon.

Reply via email to