[git-users] Re: Bring back locally deleted file, leave changes in others

2011-09-06 Thread tombert
On Sep 6, 3:09 pm, tombert  wrote:
> > P.S.
> > Please don't top-post.

I'll try to improve myself ;)

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Bring back locally deleted file, leave changes in others

2011-09-06 Thread tombert
supa! thx! that's what I was looking for.

ad top-post: I didn't found any settings to change this behaviour in
my google settings.

On Sep 6, 2:24 pm, Konstantin Khomoutov
 wrote:
> On Tue, 6 Sep 2011 04:22:00 -0700 (PDT)
>
>
>
>
>
>
>
>
>
> tombert  wrote:
> > > > I perform some changes in several files, then I delete two files
> > > > because I want to discard those changes.
>
> > > > rm myfile1.txt
> > > > rm myfile2.txt
>
> > > > Is there a way of bringing back those files with knowing its name?
>
> > > > I could use "git checkout ." but this would discard changes in the
> > > > other files ...
>
> > > git checkout -- myfile1.txt myfile2.txt
>
> > > Actually, this is what Git tells you do do when you run `git status`
> > > so pay close attention to this output.
>
> > > Note that that `git checkout` encantation is what you should have
> > > used in the first place instead of deleting the files.
> > Hi and thx for the reply, actually I'am reading the docs and
> > investigating ... so up now there is no harm.
>
> > But your solution I already knew. What I asked for was "... without
> > knowing its name ..." and without discarding local modified files i.e.
> > an equivalent to "cvs update".
>
> Then `git checkout-index --all` appears to be the closest thing I have
> managed to find.
>
> Here I have two files in the HEAD, aaa.txt and bbb.txt,
> now I delete aaa.txt and modify bbb.txt and run git-checkout-index:
>
> C:\tmp\foo>git status
> # On branch master
> # Changes not staged for commit:
> #   (use "git add/rm ..." to update what will be committed)
> #   (use "git checkout -- ..." to discard changes in working
> # directory)
> #
> #       deleted:    aaa.txt
> #       modified:   bbb.txt
> #
> no changes added to commit (use "git add" and/or "git commit -a")
>
> C:\tmp\foo>git checkout-index --all
> bbb.txt already exists, no checkout
>
> C:\tmp\foo>git status
> # On branch master
> # Changes not staged for commit:
> #   (use "git add ..." to update what will be committed)
> #   (use "git checkout -- ..." to discard changes in working
> # directory)
> #
> #       modified:   bbb.txt
> #
> no changes added to commit (use "git add" and/or "git commit -a")
>
> It appears that for big checkouts, the "--quiet" option is convenient
> as well.
>
> P.S.
> Please don't top-post.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Re: Bring back locally deleted file, leave changes in others

2011-09-06 Thread Konstantin Khomoutov
On Tue, 6 Sep 2011 04:22:00 -0700 (PDT)
tombert  wrote:

> > > I perform some changes in several files, then I delete two files
> > > because I want to discard those changes.
> >
> > > rm myfile1.txt
> > > rm myfile2.txt
> >
> > > Is there a way of bringing back those files with knowing its name?
> >
> > > I could use "git checkout ." but this would discard changes in the
> > > other files ...
> >
> > git checkout -- myfile1.txt myfile2.txt
> >
> > Actually, this is what Git tells you do do when you run `git status`
> > so pay close attention to this output.
> >
> > Note that that `git checkout` encantation is what you should have
> > used in the first place instead of deleting the files.
> Hi and thx for the reply, actually I'am reading the docs and
> investigating ... so up now there is no harm.
> 
> But your solution I already knew. What I asked for was "... without
> knowing its name ..." and without discarding local modified files i.e.
> an equivalent to "cvs update".
Then `git checkout-index --all` appears to be the closest thing I have
managed to find.

Here I have two files in the HEAD, aaa.txt and bbb.txt,
now I delete aaa.txt and modify bbb.txt and run git-checkout-index:

C:\tmp\foo>git status
# On branch master
# Changes not staged for commit:
#   (use "git add/rm ..." to update what will be committed)
#   (use "git checkout -- ..." to discard changes in working
# directory)
#
#   deleted:aaa.txt
#   modified:   bbb.txt
#
no changes added to commit (use "git add" and/or "git commit -a")

C:\tmp\foo>git checkout-index --all
bbb.txt already exists, no checkout

C:\tmp\foo>git status
# On branch master
# Changes not staged for commit:
#   (use "git add ..." to update what will be committed)
#   (use "git checkout -- ..." to discard changes in working
# directory)
#
#   modified:   bbb.txt
#
no changes added to commit (use "git add" and/or "git commit -a")

It appears that for big checkouts, the "--quiet" option is convenient
as well.

P.S.
Please don't top-post.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Bring back locally deleted file, leave changes in others

2011-09-06 Thread tombert
Hi and thx for the reply, actually I'am reading the docs and
investigating ... so up now there is no harm.

But your solution I already knew. What I asked for was "... without
knowing its name ..." and without discarding local modified files i.e.
an equivalent to "cvs update".

thx


On Sep 6, 12:14 pm, Konstantin Khomoutov
 wrote:
> On Tue, 6 Sep 2011 02:44:18 -0700 (PDT)
>
> tombert  wrote:
> > I perform some changes in several files, then I delete two files
> > because I want to discard those changes.
>
> > rm myfile1.txt
> > rm myfile2.txt
>
> > Is there a way of bringing back those files with knowing its name?
>
> > I could use "git checkout ." but this would discard changes in the
> > other files ...
>
> git checkout -- myfile1.txt myfile2.txt
>
> Actually, this is what Git tells you do do when you run `git status`
> so pay close attention to this output.
>
> Note that that `git checkout` encantation is what you should have used
> in the first place instead of deleting the files.
>
> > I'am looking for an equivaltent of "cvs update".
>
> It's way better to instead start with some book on Git to have
> appropriate mindset before you devle into serious work with Git.
> It's one of those cases where knowledge of CVS might do more harm than
> good.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.