Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lost config files from home disk, after adding to a commit #38

Open
plum opened this issue Feb 14, 2023 · 3 comments
Open

Lost config files from home disk, after adding to a commit #38

plum opened this issue Feb 14, 2023 · 3 comments

Comments

@plum
Copy link

plum commented Feb 14, 2023

I am new to dotbare it seems great. Rather special

Before I resort to my disk backup of yesterday, (and saving about an hours work in changes since then), am i able somehow to retrieve lost files?

I staged a first commit , pushed to git, with just a read me, and then ,

  • Somehow detached from HEAD, a branch 'master'
  • About 100 config files in all added, from ~ , and then subsequently from .config, , bu
  • I suspect i added the bulk (I.E. from .config) to the new branch of master, detached form HEAD.

I attempted and succeeded to revert to the 1 st commit,.. in order not to use a detached branch, for newly added/ and staged files.

I see in fedit, and in checkout that the .config files have disappeared from my disk and in 'fedit' they are visible in red with a ?? preceding.

1 st commit remains.
Only the 12 files from home directory remain, staged and ready.
Second commit has vanished.

Thanks,
John
I don't see them in trashes.

@kazhala
Copy link
Owner

kazhala commented Feb 14, 2023

Hey mate,

Have a look at fcheckout which I think should solve your issue.

It should restore your deleted file using git.

@plum plum changed the title Lost config files for disk, after setting adding to a commit Lost config files from home disk, after adding to a commit Feb 14, 2023
@kazhala
Copy link
Owner

kazhala commented Feb 14, 2023

After reading your description for about 2 times I apologise that I may not still fully understand how you end up in the current state.

But in situations like this, either freset(unstage)or fcheckout would be your option. Please take a look at the (git checkout -- file ) and (git reset) document to see which one fits your need better

@plum
Copy link
Author

plum commented Feb 20, 2023

@ kahzal
Thanks for kind reply. I think it was because I used fcheckout that I lost the additions I had made to the initial branch.
I want' sure from reading docs and form their names, reading the how to's what fstat and what fcheckout really were.
I see now I should have used fstat to stage commit.0

ANyway, I hadn't had the additions up on github remote repo, these were new additions, ready for commit.

Because dotbare acts on the actual local files in one's local config dir to mirror the old branch checked out, it had deleted them all, leaving only the initial one or tow test config files I had added!
Now, from the docs I didn't know that was the case. It might have used an alternative strategy for configs - symlinking the files.

luckily I keep a backup!

I likely could have somehow found those 'additions' somewhere in cache, but decided to simply restore from local backup and start over again with dotbare on my local repo. That is, because I otherwise couldn't get rid of the ??missing_Filename.config marks in the list. Well, perhaps if I had re-added my config files after restoring form backup, they may have disappeared; but starting again amounted to the same thing anyway. I had to add those again.

Now I have a grip on it, all is OK and it's very nice to have all one's config files at hand in one command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants