From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: index manipulation quickref
Date: Tue, 12 Dec 2006 12:16:58 +0100 [thread overview]
Message-ID: <elm2ur$3ib$1@sea.gmane.org> (raw)
In-Reply-To: fcaeb9bf0612120257p35dc9483ob65eea9ae21b5f7b@mail.gmail.com
Nguyen Thai Ngoc Duy wrote:
> I'm trying to collect all operations related to index from user
> perspective and corresponding commands. The list may be put to git
> wiki if people think it can help newbies:
>
> update file content to index: git update-index file
Or "git add file" woth new git.
> add a file to index: git add file
> delete a file from index: git update-index --remove --force-remove
> (or remove that file in workdir and do git update-index --remove)
Or "git rm file" (old version did remove only from index, new version
is to remove also from working directory if it matches HEAD)
> read a tree to index: git read-tree treeish, git reset treeish
> read a file from a tree to index: git ls-tree <tree-ish> file|git
> update-index --index-info --stdin
> copy a file from index to workdir: git checkout-index file
Or just "git checkout -- file"
> refresh index: git update-index --refresh
> copy entire index to workdir: git checkout-index
Or just "git checkout"
> output a file from index to stdout: ?? (is there a command for this?)
"git cat-file -p ::<filename>"
> list files in index: git ls-files
> compare index and workdir file listing:
> git ls-files (with lots of options here)
> diff between workdir and index: git diff
> diff between index and a tree: git diff --cached <tree-ish>
diff between workdir and tree: git diff <tree-ish>
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
next prev parent reply other threads:[~2006-12-12 11:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-12 10:57 index manipulation quickref Nguyen Thai Ngoc Duy
2006-12-12 11:16 ` Jakub Narebski [this message]
2006-12-12 11:28 ` Santi Béjar
2006-12-12 18:18 ` Junio C Hamano
2006-12-12 21:32 ` Nguyen Thai Ngoc Duy
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='elm2ur$3ib$1@sea.gmane.org' \
--to=jnareb@gmail.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).