It's all about the answers!

Ask a question

How to do something like "git add -p"?


Christian Höltje (5810) | asked Nov 11 '13, 12:20 p.m.
retagged Dec 16 '13, 4:17 p.m. by David Lafreniere (4.3k7)
 In git you can do "git add -p" and it walks you through the hunks in a diff and lets you choose which parts of pending changes in a file to add to commit.

Can you do this in RTC? I suspect the underlying architecture can handle it but I can't find a UI or 'scm' command for it.

In RTC this would be choosing what parts of files to add to commit before you package it up for deliver.

Example of "git add -p" in action: http://asciinema.org/a/6337

Accepted answer


permanent link
Robert Carter (42926883) | answered Nov 11 '13, 3:13 p.m.
 If your changes to the file where contained in two separate change sets then you could deliver/commit the change set the has the changes you want.  RTC makes you evaluate and deliver "Change Sets" but is not good a cherry picking changes within a change set.  So,  you could have very granular change sets which gives you the ability to cherry pick "changes"  or your abstract your changes a little bit higher and lump them together in to discrete "change sets" and manage those.

If you have a change set the needs to be broken up/divided up.  You can do this but it gets complicated.  Basically, you take your one change set, then create a "patch" change set which removes the stuff you want out.  Together, the original change set and the patch change set make up the one change set you want to deliver minus the stuff your don't want.  Then you create a third change set and put back the stuff, you want, so it is in its own change set.

Change Set A - has changes 1,2,3
Patch Change Set - has -3
Change Set A + patch Change Set = has changes 1,2
Change set B you create - put changes 3

Christian Höltje selected this answer as the correct answer

Your answer


Register or to post your answer.