Re: [git-users] Changed but not updated and Changes not staged for commit

2012-09-17 Thread Konstantin Khomoutov
On Mon, 17 Sep 2012 00:23:40 -0700 (PDT)
Ivan Ionut  wrote:

[...]
> > Well after i modified a file... after git status:
> >
> > # Changes not staged for commit:
> > #   (use "git add ..." to update what will be committed)
> > #   (use "git checkout -- ..." to discard changes in working 
> > directory)
> > #
> > #modified:   file2
> > #
> >
> > I need to understand why it didn't show:
> >
> > # Changed but not updated:
> > #   (use "git add ..." to update what will be committed)
> > #
> > #   modified:   file2
> > #
[...]
> And how to do it like in the book?

That's simply a textual change in how `git status` formulates the
situation you're talking about -- a bit of history diving brings this:

% git log -F -S 'staged for commit' -- wt-status.c
commit 8009d83c7e7af0a298ef858609a8201d01086396
Author: Matthieu Moy 
Date:   Tue Nov 2 16:31:19 2010 +0100

Better "Changed but not updated" message in git-status

Older Gits talked about "updating" a file to add its content to the
index, but this terminology is confusing for new users. "to stage"
is far more intuitive and already used in e.g. the "git stage" command
name.

Signed-off-by: Matthieu Moy 
Signed-off-by: Junio C Hamano 

% git name-rev 8009d83c7
8009d83c7 tags/v1.7.4-rc0~122^2~9

So the change appeared in Git v1.7.4.
Supposedly the examples in the book you're reading were recorded
using a version of Git older than 1.7.4.

-- 
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] Changed but not updated and Changes not staged for commit

2012-09-17 Thread Ivan Ionut


On Sunday, September 16, 2012 9:20:26 PM UTC+3, Philip Oakley wrote:
>
>  *From:* Ivan Ionut  
>
> *To:* git-...@googlegroups.com  
> *Sent:* Sunday, September 16, 2012 7:06 PM
> *Subject:* [git-users] Changed but not updated and Changes not staged for 
> commit
>
> Well after i modified a file... after git status:
>
> # Changes not staged for commit:
> #   (use "git add ..." to update what will be committed)
> #   (use "git checkout -- ..." to discard changes in working 
> directory)
> #
> #modified:   file2
> #
>
> I need to understand why it didn't show:
>
> # Changed but not updated:
> #   (use "git add ..." to update what will be committed)
> #
> #   modified:   file2
> #
>
> The reason that the "git checkout -- " is provided is because it is 
> a method for fetching that specific file from your index and in doing so 
> discarding any recent changes. 
>  
> That is, you can go forward with "git add ",
> or you can go back with "git checkout -- ".
>  
> There is no 'git reset' for just a single file. Reset applies to a whole 
> commit.
>  
> The "git checkout -- " can get the file from any commit if one is 
> given in the command (see the man page). Getting it fromm the index is the 
> default.
>  
> The "--" is the separator that ensures that everying after it is a 
> pathspec (see 'git rev-parse --help' and the 'git cli --help').
>  
> Philip
>


But i need a reason for "# Changed but not updated:"

All what i done( from 
http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository) 
is this:


adminmint@adminmint-System-Product-Name /var/www $ mkdir test
adminmint@adminmint-System-Product-Name /var/www $ cd test
adminmint@adminmint-System-Product-Name /var/www/test $ git init
Initialized empty Git repository in /var/www/test/.git/

Then i created a file called new_file

adminmint@adminmint-System-Product-Name /var/www/test $ git status
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add ..." to include in what will be committed)
#
#new_file
nothing added to commit but untracked files present (use "git add" to track)

The i add some text: "asdf"

adminmint@adminmint-System-Product-Name /var/www/test $ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached ..." to unstage)
#
#new file:   new_file
#
# Changes not staged for commit:
#   (use "git add ..." to update what will be committed)
#   (use "git checkout -- ..." to discard changes in working 
directory)
#
#modified:   new_file
#

So why it doesn't ouput like this:


# Changes to be committed:
#   (use "git reset HEAD ..." to unstage)
#
#   new file:   new_file
#
# Changed but not updated:
#   (use "git add ..." to update what will be committed)
#
#   modified:   new_file

And how to do it like in the book?

ps: my english is terrible





-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/AI_IDmZjRqkJ.
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] Changed but not updated and Changes not staged for commit

2012-09-16 Thread Philip Oakley
From: Ivan Ionut 
  To: git-users@googlegroups.com 
  Sent: Sunday, September 16, 2012 7:06 PM
  Subject: [git-users] Changed but not updated and Changes not staged for commit


  Well after i modified a file... after git status:

  # Changes not staged for commit:
  #   (use "git add ..." to update what will be committed)
  #   (use "git checkout -- ..." to discard changes in working directory)
  #
  #modified:   file2
  #

  I need to understand why it didn't show:


# Changed but not updated:
#   (use "git add ..." to update what will be committed)
#
#   modified:   file2
#The reason that the "git checkout -- " is provided is because it is a 
method for fetching that specific file from your index and in doing so 
discarding any recent changes. 

That is, you can go forward with "git add ",
or you can go back with "git checkout -- ".

There is no 'git reset' for just a single file. Reset applies to a whole commit.

The "git checkout -- " can get the file from any commit if one is given 
in the command (see the man page). Getting it fromm the index is the default.

The "--" is the separator that ensures that everying after it is a pathspec 
(see 'git rev-parse --help' and the 'git cli --help').

Philip

-- 
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] Changed but not updated and Changes not staged for commit

2012-09-16 Thread Ivan Ionut
Well after i modified a file... after git status:

# Changes not staged for commit:
#   (use "git add ..." to update what will be committed)
#   (use "git checkout -- ..." to discard changes in working 
directory)
#
#modified:   file2
#

I need to understand why it didn't show:

# Changed but not updated:
#   (use "git add ..." to update what will be committed)
#
#   modified:   file2
#


-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/y9KWHnqmGyUJ.
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.