前回のコミット以降、プロジェクト内のファイルに変更を加えたばかりの場合、git stash は正常に機能します。
ただし、最後のコミット以降にプロジェクトに新しいファイルも追加した場合、次のエラーで失敗します。
C:\Program Files\Git\cmd\git.exe stash save QtCreator 2013-01-08T12:06:51
"C:\MyProject" に stash できません: エラー: エントリ 'NewFile.cpp' が最新ではありません。マージできません。
現在のワークツリーの状態を保存できません
このエラーが表示されるのはなぜですか?また、プロジェクトに新しいファイルを追加した場合、変更を隠しておく方法はありますか?
編集
ここに出力がありますgit status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: NewFile.cpp
#
# 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: MyFile.cpp
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# MyProject.pro.user