2017-07-07 27 views
0

のは、私は、このディレクトリ構造を持っているとしましょう:兄弟ディレクトリ

 
project_root 
| 
+--parent 
    | 
    +--child 
    | 
    +--baby_brother 

baby_brotherはgitのことで追跡されていない、新しいディレクトリです。私はchildのファイルに多くの変更を加えました。私はchild内のファイルの以前のバージョンへの一時的なアクセスを必要とするので、私は、私はちょうど私の変更を隠したい考え出し:

cd $project_root/parent/child 
git stash push . 

その後、後:

私の落胆にずっと今
cd $project_root/parent/child 
git stash pop 

baby_brother 1週間分の作業と一緒に行方不明になっています。 :-(

私は2つの質問があります。

  1. は戻って私のファイルを取得する方法はあります、私は答えは「ノー」である疑いがある

  2. これはバグですか、やりました?。私が何かを間違っていますか?私はそれが人跡未踏のファイルを削除するにはgitのための行動を期待していますが、1のために、それはまた、私は2.13を使用しています(これは1.7.1.1で修正されたと言う言うan SO questionを見てきました

。 0)、私はそのディレクトリにいて、現在のディレクトリを参照するコマンドの最後にドットが含まれていたので、2人のために、私は隠しがchildに影響することを期待しました。ここで


は、問題を示し、迅速REPROです:

 
1 ~ % mkdir project_root 
2 ~ % cd project_root 
3 project_root % mkdir parent 
4 project_root % touch parent/file 
5 project_root % mkdir parent/child 
6 project_root % touch parent/child/file2 
7 project_root % git init 
Initialized empty Git repository in /home/pdaddy/project_root/.git/ 
8 project_root % git add . 
9 project_root % git commit -m 'Get it in git' 
[master (root-commit) 2d0872c] Get it in git 
2 files changed, 0 insertions(+), 0 deletions(-) 
create mode 100644 parent/child/file2 
create mode 100644 parent/file 
10 project_root % mkdir parent/baby_brother 
11 project_root % touch parent/baby_brother/file3 
12 project_root % touch parent/file4 
13 project_root % touch file5 
14 project_root % comment="As it turns out, file4 and file5 will be deleted, too." 
15 project_root % tree $PWD 
/home/pdaddy/project_root 
|-- file5 
`-- parent 
    |-- baby_brother 
    | `-- file3 
    |-- child 
    | `-- file2 
    |-- file 
    `-- file4 

3 directories, 3 files 
16 project_root % echo 'some changes' >> parent/child/file2 
17 project_root % cd parent/child 
18 child % git stash push . 
Saved working directory and index state WIP on master: 2d0872c Get it in git 
19 project_root % tree ~/project_root 
/home/pdaddy/project_root 
`-- parent 
    |-- child 
    | `-- file2 
    `-- file 

2 directories, 2 files 
20 child % git stash pop 
On branch master 
Changes not staged for commit: 
    (use "git add ..." to update what will be committed) 
    (use "git checkout -- ..." to discard changes in working directory) 

     modified: file2 

no changes added to commit (use "git add" and/or "git commit -a") 
Dropped refs/[email protected]{0} (80e41d0ed1f2b0a085d4f5ca3a38833a18873f98) 
21 child % tree ~/project_root 
/home/pdaddy/project_root 
`-- parent 
    |-- child 
    | `-- file2 
    `-- file 

2 directories, 2 files 

答えて

0

私はgitののnext支店(v2.14.0.rc0)と私のREPRO例をテストし、問題は自分自身を提示していませんでした、だから、これはバグだと思うし、誰かが修正を約束している。

関連する問題