TheLocehiliosan / yadm

Yet Another Dotfiles Manager
https://yadm.io/
GNU General Public License v3.0
5.07k stars 176 forks source link

.git folder #350

Closed xenoterracide closed 3 years ago

xenoterracide commented 3 years ago

where does yadm keep it's .git folder? I want to rewrite some history (I'm going to make my repo public, but there's some credentials stored unencrypted in a commit accidentally). I was just going to rebase everything, but it turns out that's going to be super painful in part because git clean being disabled (which is also understandable)

erijo commented 3 years ago

Run yadm introspect repo

xenoterracide commented 3 years ago

just running yadm introspect doesn't output any help, might be worth fixing

rasa commented 3 years ago

yadm help tells you .git's location:

yadm help | grep '\.git'
  $HOME/.local/share/yadm/repo.git - yadm's Git repository
danielbehrendt commented 3 years ago

Is there any way to open the repo in a tool like Tower or Fork? Trying to open it ends in message that there couldn't be any repo found at the given path.

rasa commented 3 years ago

You can try using yadm enter or setting export GIT_DIR=$HOME/.local/share/yadm/repo.git or setting set GIT_DIR=%USERPROFILE%\.local\share\yadm\repo.git in Windows.

danielbehrendt commented 3 years ago

You can try using yadm enter or setting export GIT_DIR=$HOME/.local/share/yadm/repo.git or setting GIT_DIR=%USERPROFILE%\.local\share\yadm\repo.git in Windows.

Thank you for the suggestions. Tried them out but without any luck. When I try to open the path in "Tower" it asks me to create a new repository because the give directory seems not to be a Git repo (no matter where I search: neither in "$HOME" nor in "$HOME/.local/share/yadm/repo.git". I've added "export GIT_DIR=$HOME/.local/share/yadm/repo.git" to my exports.

rasa commented 3 years ago

I only need to set GIT_DIR to use other git-aware tools, but you could try setting export GIT_WORK_TREE=$HOME or setting set GIT_WORK_TREE=%USERPROFILE% in Windows, as GIT_WORK_TREE is set by yadm enter.

See https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables for more info.

danielbehrendt commented 3 years ago

I only need to set GIT_DIR to use other git-aware tools, but you could try setting export GIT_WORK_TREE=$HOME or setting set GIT_WORK_TREE=%USERPROFILE% in Windows, as GIT_WORK_TREE is set by yadm enter.

See https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables for more info.

Yes, on the shell it works (when GIT_DIR is exported), but have you openend the yadm repo in any UI (GitKranken, Tower, SourceTree, etc.) successfully?

rasa commented 3 years ago

I've not used any of those previously, but the gitk UI program works, if I just set GIT_DIR. And I can start it from any directory, even those not rooted at $HOME. I tried using GitKraken, and SourceTree, but not only did they both fail to open $HOME/.local/share/yadm/repo.git, but one of them silently deleted all my checked out files in my $HOME directory (it left other files). I wouldn't use either of these again for that reason. I didn't try Tower.

andreineculau commented 3 years ago

Why not "git clone ~/.local/share/yadm/repo.git" which creates a regular checkout, rewrite history in your GUI of choice, push force (which would push to the local repo.git folder), and from there on i guess "yadm push -f" to push force to your remote git repo?

xenoterracide commented 3 years ago

I'm not sure if there's a reason for this to still be open...

brechtm commented 2 years ago

I was able to open the yadm worktree (my home directory) in Fork by symlinking ~/.local/share/yadm/repo.git to ~/.git. To prevent Fork from scanning all of my home directory, I also created a .gitignore file containing just *. To have Fork show files that are not checked in yet, you can "unignore" dotfiles by adding some lines to the .gitignore:

*
!.*
.DS_Store
!.config/**/*