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
ssh -N -L <local_port>:<host2_ip>:<destination_port> -i <private_key_path> <user_name>@<host1_ip> |
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
ssh -N -L <local_port>:127.0.0.1:<destination_port> -i <private_key_path> <user_name>@<host_ip> |
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
#!/bin/bash | |
function git { | |
if [[ "$1" = "merge" && "$@" != *"--help"* && "$@" != *"--abort"* ]]; then | |
git_merge_wrapper "$@"; | |
else | |
command git "$@" | |
fi | |
} |
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
#!/bin/bash | |
# Get the current branch name | |
branch_name=$(git branch | grep "*" | sed "s/\* //") | |
# if the merged branch was master - don't do anything | |
if [[ $branch_name = "master" ]]; then | |
echo "Preparing to merge to master..." | |
if git diff --cached | grep '^[+d].*NO_MERGE'; then | |
echo "Can't merge branch with 'NO_MERGE' comment, fix what you need and try again!" |
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
#!/bin/bash | |
if git diff --cached | grep '^[+d].*NO_COMMIT'; then | |
echo "Can't commit file with NO_COMMIT comment, remove the debug code and try again" | |
exit 1 | |
fi |
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
function repo { | |
source ~/virtual_envs/$1/bin/activate; | |
cd ~/git_repositories/$1 | |
} | |
function _repo { | |
_arguments "1: :($(ls ~/git_repositories))" | |
} | |
compdef _repo repo |