使用git,我正在主分支上工作,并有一些未添加和未提交的文件。我不想将它们添加或提交到主分支上。相反,我正在尝试将这些文件藏起来并移动到一个新的分支上,在那里添加并提交它们。然而,这个过程失败了,出现了错误消息:“找不到存储”。请参见下面的日志:
$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: Makefile
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# newfile.c
no changes added to commit (use "git add" and/or "git commit -a")
当我尝试使用git stash时
$git stash branch mywork
No stash found.
我相信以前我使用过类似的方式来运用git stash,但我不知道为什么现在它失败了。怎样把我的更改暂存到另一个分支并提交它们?