Re: merge only some of the changed files?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



fkater@xxxxxxxxxxxxxx venit, vidit, dixit 19.03.2010 14:40:
> Hi all,
> 
> I am quite new to git.
> 
> If I want to merge branch B into A, however not all of the
> changed files in B, how do I do that?
> 
> In other words: 'git diff --name-only A..B' lists 10 files
> but I want to merge only 5 of them.

If you are sure you don't want to merge the changes to them later on,
you can do the following while on branch A

# perform the merge but do not commit
git merge --no-commit B
# overwrite the files you want to keep with their version from A
git checkout HEAD -- file1 file2
# commit the merge result
git commit

Cheers,
Michael
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]