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

2013-09-12 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"  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 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-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 >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 .
>> 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  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.


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

2013-09-12 Thread GregH
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.


Re: [git-users] How tell git-bush which new private key to use

2013-09-12 Thread Konstantin Khomoutov
On Thu, 12 Sep 2013 05:47:07 -0700 (PDT)
berd  wrote:

> >Do you have to keep the test key or you just want to *replace* it
> >with the 
> production key?
> 
> I want replace the test key to production key.

Okay.  Next time please write your intent clearly -- that would have
saved me from typing 60% of my first answer :-)

> > If replacement is needed, then just overwrite the  id_rsa and
> > id_rsa.pub 
> files in your %HOME%\.ssh folder with the new 
> 
> > ones (they might also be named id_dsa[.pub], and the .pub file (the 
> public part of the key)
> 
> You mean, I can the new key only copt in folder g:/.ssh/

As it turns out based on the new information from you, not quite.
I'll explain why in a moment.

> A point to note is still, the name of my nek key ist
> "mykey_130903.pub" and "mykey-privatekey_130903.ppk" is this
> important?

That's good you mentioned this (again, note that the more information
you tell the better for everyone).

The extension ".ppk" suggests this is the key generated by PuTTY's key
generation tool (puttygen.exe) *in its own container format,* not
compatible with the OpenSSH client distributed as part of Git for
Windows.  A corollary to this is that there's no sense in putting those
keys into %HOME%/.ssh -- the OpenSSH client can't make use of them
anyway.

That "mykey_130903.pub" had most probably been extracted from the .ppk
key (using that same puttygen.exe tool) and given to you so you could
make your private key trusted on the remote system (that thing is
beyond the scope of our present discussion though).

Can you verify your .ppk key is generated by PuTTY?  Open it in a text
editor and look at the first line -- does it read something like

PuTTY-User-Key-File-2: ssh-rsa

or

-BEGIN RSA PRIVATE KEY-

Which one?  The first means it's a PuTTY-compatible form, the second
means it's an OpenSSH-compatible form.

If the key would turn out to be of the *second* form, just copy it
under %HOME%\.ssh and name it "id_rsa" -- possibly replacing whatever
key is already there under that name.

Now remove all the Host-entry hacks you might have in your
%HOME%\.ssh\config file.

If, instead, the key turn out to be PuTTY's, you have two options:

* Get PuTTY and convert your .ppk key file into an OpenSSH-compatible
  format using puttygen.exe.

  You run puttygen, click the Load button in its interface, enter the
  key's passphrase to decrypt the key then engage the "Conversions ->
  Export OpenSSH key" main menu entry; when asked for a file to save,
  navigate to your %HOME%\.ssh folder and choose "id_rsa" as the name
  of the file.

* Work with PuTTY as I described in my previous mail and just use this
  .ppk key file.

  To do this, you first set up Git to use PuTTY's plink.exe as its SSH
  client (via setting the GIT_SSH environment variable), then start
  pageant.exe (the key agent), activate the context menu on its tray
  icon, choose the "Add key" entry then select your .ppk key in the
  dialog, and enter the key's passphrase when asked.

> Sorry, I forgot to write that I'm using TortoiseGIT.

TortoiseGit relies on calling stock Git binary and so respects the
GIT_SSH setup already explained.  You can also just use plain Git along
with this front-end.

> ssh -T -vvv user@host git --version

> sh.exe": c:xampphtdocsworkspace_aptanarepositorisbmykey_130911.ppk:
> command not found 

Something awry with the formatting.  And I have no idea why the key
file is mentioned -- as I've say, if .ppk is not just a brain-dead
extension and key is PuTTY's, stock SSH client won't work with it.

> Here is first error, my key, that I use ist mykey_130903.ppk not 
> mykey_130911.ppk

That's not the problem, I reckon.

> eval $(ssh-agent -s)
> 
> Agent pid 9528
> 
> ssh-add mykey_130903.ppk

That's strange!  It *might* turn out that just the person who handed
you this key is idiot, and the key is in OpenSSH format indeed.

Anyway, I gave you enought information to deal with either case.

> after this I make pull "git pull" and get following message:
> fatal: Not a git repository (or any of the parent directories): .git

As you should have guessed by yourself, this error has nothing to do
with keys and SSH: it simply tells you you're currently not in a
directly which Git is able to identify as the work tree of a Git
repository.  Change the directory to a real repository and retry.

-- 
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 tell git-bush which new private key to use

2013-09-12 Thread berd


Hi,

 

>Do you have to keep the test key or you just want to *replace* it with the 
production key?

I want replace the test key to production key.

 

 

> If replacement is needed, then just overwrite the  id_rsa and id_rsa.pub 
files in your %HOME%\.ssh folder with the new 

> ones (they might also be named id_dsa[.pub], and the .pub file (the 
public part of the key)

You mean, I can the new key only copt in folder g:/.ssh/

 

A point to note is still, the name of my nek key ist "mykey_130903.pub" and 
"mykey-privatekey_130903.ppk" is this important?

 

Sorry, I forgot to write that I'm using TortoiseGIT.

 

>How exactly did it not work out?

I can work with TortoiseGIT with the new key, key form 03.09.2013.

 

ssh -T -vvv user@host git --version

 

sh.exe": c:xampphtdocsworkspace_aptanarepositorisbmykey_130911.ppk: command 
not found 

 

Here is first error, my key, that I use ist mykey_130903.ppk not 
mykey_130911.ppk

 

eval $(ssh-agent -s)

Agent pid 9528

 

 

ssh-add mykey_130903.ppk

 

after this I make pull "git pull" and get following message:

 

fatal: Not a git repository (or any of the parent directories): .git

-- 
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.