diff --git a/bin/bin/pull-dotfiles b/bin/bin/update-dotfiles old mode 100755 new mode 100644 similarity index 69% rename from bin/bin/pull-dotfiles rename to bin/bin/update-dotfiles index d0f9858..2d22b3a --- a/bin/bin/pull-dotfiles +++ b/bin/bin/update-dotfiles @@ -2,9 +2,9 @@ if [ -d "${HOME}/.dotfiles" ]; then cd $HOME/.dotfiles - git reset --hard && git pull + git pull --rebase --autostash fi if [ -d "${HOME}/.dotfiles-private" ]; then cd $HOME/.dotfiles-private - git reset --hard && git pull + git pull --rebase --autostash fi \ No newline at end of file diff --git a/posh/Microsoft.PowerShell_profile.ps1 b/posh/Microsoft.PowerShell_profile.ps1 index a743af7..4590196 100644 --- a/posh/Microsoft.PowerShell_profile.ps1 +++ b/posh/Microsoft.PowerShell_profile.ps1 @@ -14,6 +14,12 @@ function Add-SshKey { } } +function Update-Dotfiles { + Join-Path $HOME '.dotfiles' | Push-Location + Invoke-Expression -Command "git pull --rebase --autostash" + Pop-Location +} + $DotFilesPath = Join-Path $HOME '.dotfiles' $DotFilesAutodetect = $true $DotFilesAllowNestedSymlinks = $true