简体   繁体   中英

specific delta need to merge on git from one branch to another

I have two branches b1 and b2 on git.

I have made changes lets say c1 c2 c3 c4 c5 c6 though respected bug b1 b2 b3 b4 b5 b6 bug number on branch b1, I want to merge only change c1 c3 c4 respected bug b1 b3 b4 to branch b2. how to do it through git command line and if conflicts come how to resolve it.

Your commits aren't in a position where they can be taken with a merge command, so your best bet is git cherry-pick . Use like this:

$ git checkout b2
$ git cherry-pick c1 c3 c4

If there are conflicts, you'll be prompted to resolve them interactively.

There won't be any tracking that they're in, so if you end up merging later on, those will show up as conflicts.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM