On Sunday, September 16, 2012 9:20:26 PM UTC+3, Philip Oakley wrote:
>
>  *From:* Ivan Ionut <javascript:> 
>
> *To:* git-...@googlegroups.com <javascript:> 
> *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 <file>..." to update what will be committed)
> #   (use "git checkout -- <file>..." to discard changes in working 
> directory)
> #
> #    modified:   file2
> #
>
> I need to understand why it didn't show:
>
> # Changed but not updated:
> #   (use "git add <file>..." to update what will be committed)
> #
> #   modified:   file2
> #
>
> The reason that the "git checkout -- <file>" 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 <file>",
> or you can go back with "git checkout -- <file>".
>  
> There is no 'git reset' for just a single file. Reset applies to a whole 
> commit.
>  
> The "git checkout -- <file>" 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 <file>..." 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 <file>..." to unstage)
#
#    new file:   new_file
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." 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 <file>..." to unstage)
#
#   new file:   new_file
#
# Changed but not updated:
#   (use "git add <file>..." 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.

Reply via email to