git init --bare $HOME/.homegit
alias homegit='git.exe --git-dir=$HOME/.homegit/ --work-tree=$HOME'
homegit config --local status.showUntrackedFiles no
homegit remote add origin git@github.com:seguri/homegit-wsl2.git
homegit add README.md
homegit commit -m 'Initial commit'
homegit push
I thought that using alias ssh=ssh.exe
was enough to be able to push this repository to GitHub through 1Password SSH integration, but it seems I was wrong.
Using git.exe
fixed the problem and the homegit
alias is fixed accordingly.
git.exe clone --separate-git-dir=$HOME/.homegit git@github.com:seguri/homegit-wsl2.git $HOME/.homegit-tmp
cp ~/.homegit-tmp/.gitmodules ~ # If you use submodules
rm -r $HOME/.homegit-tmp
alias homegit='git.exe --git-dir=$HOME/.homegit/ --work-tree=$HOME'
homegit reset --hard origin/main
- The first repo I created with this technique