Re: [git-users] how to commit one line/change only from a branch back to the master?

2013-09-13 Thread Thomas Ferris Nicolaisen
On Thursday, September 12, 2013 10:06:40 PM UTC+2, Gergely Polonkai wrote:

 Cherry picking is your friend here. The easiest way maybe if you add the 
 bug fixing two lines as a separate commit. This way you will only have to 
 cherry pick that only commit. Otherwise, you may add -n to git-cherrypick, 
 so it won't commit the cherry picked commit instantly, but let you 
 investigate and possibly modify it.


Also, a nice trick is to do git add --patch (-p) to stage just the lines 
you want and then committing (not sure if cherrypick will stage, but do a 
reset first if so).

-- 
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 git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] how to commit one line/change only from a branch back to the master?

2013-09-13 Thread Gergely Polonkai
Cherrypick commits by default. You can add -n to prevent it, in which case
the picked changes will be staged, and the commit message will be filled
with the original commit message.
On 13 Sep 2013 08:31, Thomas Ferris Nicolaisen tfn...@gmail.com wrote:

 On Thursday, September 12, 2013 10:06:40 PM UTC+2, Gergely Polonkai wrote:

 Cherry picking is your friend here. The easiest way maybe if you add the
 bug fixing two lines as a separate commit. This way you will only have to
 cherry pick that only commit. Otherwise, you may add -n to git-cherrypick,
 so it won't commit the cherry picked commit instantly, but let you
 investigate and possibly modify it.


 Also, a nice trick is to do git add --patch (-p) to stage just the lines
 you want and then committing (not sure if cherrypick will stage, but do a
 reset first if so).

 --
 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 git-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] how to commit one line/change only from a branch back to the master?

2013-09-12 Thread Gergely Polonkai
Cherry picking is your friend here. The easiest way maybe if you add the
bug fixing two lines as a separate commit. This way you will only have to
cherry pick that only commit. Otherwise, you may add -n to git-cherrypick,
so it won't commit the cherry picked commit instantly, but let you
investigate and possibly modify it.


On 12 September 2013 21:47, GregH greg.hauptm...@gmail.com wrote:

 What would be the steps required to achieve this?

 * create branch to work on a bug branch1 from master
 * checkout branch1
 * make lots of changes to branch1 putting in print statements all over
 the place etc, but then identifying the actual issue  fixing
 * in summary say then there are 20 changes in branch1 but only 2 changes
 (say one in two different files) are the bug fix itself

 Question is from this state how do a best with minimal work in git commit
 just these 2 changes only back to the main branch?

 Note - Probably doesn't affect the answer but I'm using SourceTree as my
 git GUI.


 thanks

 --
 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 git-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] how to commit one line/change only from a branch back to the master?

2013-09-12 Thread GregH
ok thanks - I'll read up on cherry picking

On Friday, September 13, 2013 6:06:40 AM UTC+10, Gergely Polonkai wrote:

 Cherry picking is your friend here. The easiest way maybe if you add the 
 bug fixing two lines as a separate commit. This way you will only have to 
 cherry pick that only commit. Otherwise, you may add -n to git-cherrypick, 
 so it won't commit the cherry picked commit instantly, but let you 
 investigate and possibly modify it.


 On 12 September 2013 21:47, GregH greg.ha...@gmail.com javascript:wrote:

 What would be the steps required to achieve this?

 * create branch to work on a bug branch1 from master
 * checkout branch1
 * make lots of changes to branch1 putting in print statements all over 
 the place etc, but then identifying the actual issue  fixing 
 * in summary say then there are 20 changes in branch1 but only 2 
 changes (say one in two different files) are the bug fix itself

 Question is from this state how do a best with minimal work in git commit 
 just these 2 changes only back to the main branch?  

 Note - Probably doesn't affect the answer but I'm using SourceTree as my 
 git GUI.


 thanks

 -- 
 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 git-users+...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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 git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.