Created
December 19, 2018 13:16
-
-
Save bzamecnik/81566eeabbe4fb116ff7d1ced926d062 to your computer and use it in GitHub Desktop.
SSH refresh in tmux & git force pull
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# refresh SSH socket after reconnect to tmux (useful with ssh agent forwarding) | |
alias ssh_refresh='export $(tmux show-environment | grep "^SSH_AUTH_SOCK")' | |
# list current git branch | |
alias git_current_branch='git branch | grep \* | cut -d " " -f2' | |
# force pull (after rebase in remote) | |
alias git_pull_force='ssh_refresh && git fetch && git reset --hard origin/$(git_current_branch)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment