Reputation: 123
I have created a new repo in remote github and try pushing the local files after initial commit. Owing to storage size limit push got failed. Somehow the files in local disk were missing(ls -alrt lists only the empty dirs). Now those files were neither available in local disk (including trash) nor available in remote git. However, it is available in local git cache which is getting displayed in Git Desktop.
Please let me know how to retrieve them from Git Cache to local disk.
Details: Mac OS Sierra - 10.12 ++ Git - 2.19.0 ++ Github Desktop - 1.5.0
Github Desktop displaying the content from cache(?)
git log -a commit d1dd6d3c1ae871ba0ea26ae4d819c9dd2b6d1a8e (HEAD -> master) Author: A…<…com> Date: Wed Nov 14 15:34:11 2018 -0700
Revert "intial commit"
This reverts commit 9233a2e0fd96f7837d1cdf198795a9f57d3d7f4b.
commit 052adad2e2f31ed3eced327ae4893a8c0468dce4 Author: A…<…com> Date: Wed Nov 14 15:34:09 2018 -0700
Revert "initial commit"
This reverts commit 821e08a29a5cb908b187230318ee0b9f352a63cc.
commit c198ae2456bc9b0805fb35bfd08b962dbcf75173 Author: A…<…com> Date: Wed Nov 14 15:34:05 2018 -0700
Revert "initial commit"
This reverts commit 1e66da35ab95d3cbe63ed597c8aeb409cb7ad4af.
commit 1393929072b7454387bac46c4a7b81bb69b6f9ca Author: A…<…com> Date: Wed Nov 14 15:31:17 2018 -0700
added jmx files
commit 9233a2e0fd96f7837d1cdf198795a9f57d3d7f4b Author: A…<…com> Date: Wed Nov 14 15:29:49 2018 -0700
intial commit
commit 821e08a29a5cb908b187230318ee0b9f352a63cc Author: ……..MacBook-Pro.local> Date: Wed Nov 14 15:17:56 2018 -0700
initial commit
commit 1e66da35ab95d3cbe63ed597c8aeb409cb7ad4af Author: ……..MacBook-Pro.local> Date: Wed Nov 14 15:07:28 2018 -0700
initial commit
1+ Stopped git log -a
$ git status
On branch master Untracked files: (use "git add ..." to include in what will be committed)
xxxx/xxxxx-Release/TestResults/
xxxx/xxxxRelease/
xxxx/xxxx-Release/
xxxx/xxRelease/TestResults/
xxxxxx-Release/TestResults/
nothing added to commit but untracked files present (use "git add" to track)
Upvotes: 2
Views: 2522
Reputation: 1100
I think what you're referring to 'Cache' is git internal's filesystem snapshot of commit. (i.e. committed files)
If that's correct, git reset --hard 1e96da3
and git clean -f
(optional if you want to remove all untracked files).
If you want to recover some commits that are lost, then git reflog
to get lost commits' SHA-1 hash value and git reset --hard SHA-1
.
Upvotes: 4