46e91b663b
Previously the switching branch business of 'git checkout' becomes a new command 'switch'. This adds the restore command for the checking out paths path. Similar to git-switch, a new man page is added to describe what the command will become. The implementation will be updated shortly to match the man page. A couple main differences from 'git checkout <paths>': - 'restore' by default will only update worktree. This matters more when --source is specified ('checkout <tree> <paths>' updates both worktree and index). - 'restore --staged' can be used to restore the index. This command overlaps with 'git reset <paths>'. - both worktree and index could also be restored at the same time (from a tree) when both --staged and --worktree are specified. This overlaps with 'git checkout <tree> <paths>' - default source for restoring worktree and index is the index and HEAD respectively. A different (tree) source could be specified as with --source (*). - when both index and worktree are restored, --source must be specified since the default source for these two individual targets are different (**) - --no-overlay is enabled by default, if an entry is missing in the source, restoring means deleting the entry (*) I originally went with --from instead of --source. I still think --from is a better name. The short option -f however is already taken by force. And I do think short option is good to have, e.g. to write -s@ or -s@^ instead of --source=HEAD. (**) If you sit down and think about it, moving worktree's source from the index to HEAD makes sense, but nobody is really thinking it through when they type the commands. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> |
||
---|---|---|
.. | ||
add.txt | ||
advice.txt | ||
alias.txt | ||
am.txt | ||
apply.txt | ||
blame.txt | ||
branch.txt | ||
browser.txt | ||
checkout.txt | ||
clean.txt | ||
color.txt | ||
column.txt | ||
commit.txt | ||
completion.txt | ||
core.txt | ||
credential.txt | ||
diff.txt | ||
difftool.txt | ||
fastimport.txt | ||
fetch.txt | ||
filter.txt | ||
fmt-merge-msg.txt | ||
format.txt | ||
fsck.txt | ||
gc.txt | ||
gitcvs.txt | ||
gitweb.txt | ||
gpg.txt | ||
grep.txt | ||
gui.txt | ||
guitool.txt | ||
help.txt | ||
http.txt | ||
i18n.txt | ||
imap.txt | ||
index.txt | ||
init.txt | ||
instaweb.txt | ||
interactive.txt | ||
log.txt | ||
mailinfo.txt | ||
mailmap.txt | ||
man.txt | ||
merge.txt | ||
mergetool.txt | ||
notes.txt | ||
pack.txt | ||
pager.txt | ||
pretty.txt | ||
protocol.txt | ||
pull.txt | ||
push.txt | ||
rebase.txt | ||
receive.txt | ||
remote.txt | ||
remotes.txt | ||
repack.txt | ||
rerere.txt | ||
reset.txt | ||
sendemail.txt | ||
sequencer.txt | ||
showbranch.txt | ||
splitindex.txt | ||
ssh.txt | ||
stash.txt | ||
status.txt | ||
submodule.txt | ||
tag.txt | ||
transfer.txt | ||
uploadarchive.txt | ||
uploadpack.txt | ||
url.txt | ||
user.txt | ||
versionsort.txt | ||
web.txt | ||
worktree.txt |