git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arup Rakshit <aruprakshit@rocketmail.com>
To: git@vger.kernel.org
Subject: Re: Any difference to unstage files using "git checkout" and "git rm"
Date: Mon, 19 May 2014 22:41:42 +0630	[thread overview]
Message-ID: <2609761.VA4bvU75e5@linux-wzza.site> (raw)
In-Reply-To: <20140519160107.GE20289@sigill.intra.peff.net>

On Monday, May 19, 2014 12:01:07 PM you wrote:
> On Mon, May 19, 2014 at 09:12:47PM +0630, Arup Rakshit wrote:
> > Is there any difference between the below 2 commands ? I didn't see
> > anything.
> > 

> 
> Does that help?

For me who is in Git just 6-7 days, It is huge. On your way, I was walking to 
test those out. But I got some messages from Git, which made me confused to 
think, about the *philosophy of those*.

arup@linux-wzza:~> mkdir Git_tutorial
arup@linux-wzza:~> cd Git_tutorial/
arup@linux-wzza:~/Git_tutorial> LS
If 'LS' is not a typo you can use command-not-found to lookup the package that 
contains it, like this:
    cnf LS
arup@linux-wzza:~/Git_tutorial> ls
arup@linux-wzza:~/Git_tutorial> echo "welcome to git" > test.txt
arup@linux-wzza:~/Git_tutorial> ls
test.txt
arup@linux-wzza:~/Git_tutorial> git init
Initialized empty Git repository in /home/arup/Git_tutorial/.git/
arup@linux-wzza:~/Git_tutorial> git status
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       test.txt
nothing added to commit but untracked files present (use "git add" to track)
arup@linux-wzza:~/Git_tutorial> git add test.txt
arup@linux-wzza:~/Git_tutorial> git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached <file>..." to unstage)
#
#       new file:   test.txt
#

NOTE :- While, I have a new file in my repository, and I staged it, it is 
telling me to unstage it using *git rm -- cached <file>*. But once I committed, 
and the file became a tracked file in my repository, *Git* internal message got 
changed, *for unstaging*, Which is why, I asked this question. Look below -

arup@linux-wzza:~/Git_tutorial> git commit -m "commit1"
[master (root-commit) 20bf27f] commit1
 1 file changed, 1 insertion(+)
 create mode 100644 test.txt
arup@linux-wzza:~/Git_tutorial> echo "How are you enjoying?" > test.txt
arup@linux-wzza:~/Git_tutorial> git status
# On branch master
# 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:   test.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
arup@linux-wzza:~/Git_tutorial> git add test.txt
arup@linux-wzza:~/Git_tutorial> git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   test.txt
#
arup@linux-wzza:~/Git_tutorial>

It is now telling to USE "git reset HEAD <file>..." to unstage, NOT   "git rm 
--cached <file>..." to unstage.

Please let me know, If I am making you guys more confused.

-- 
===============
Regards,
Arup Rakshit

      reply	other threads:[~2014-05-19 17:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-19 14:42 Any difference to unstage files using "git checkout" and "git rm" Arup Rakshit
2014-05-19 14:57 ` Arup Rakshit
2014-05-19 16:45   ` Jeff King
2014-05-19 16:01 ` Jeff King
2014-05-19 16:11   ` Arup Rakshit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2609761.VA4bvU75e5@linux-wzza.site \
    --to=aruprakshit@rocketmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).