Skip to content

Instantly share code, notes, and snippets.

View yeuser's full-sized avatar
😏
self-investing

Yaser Eftekhari yeuser

😏
self-investing
View GitHub Profile
@yeuser
yeuser / rebase-my-branches.sh
Last active September 10, 2020 13:59
This sh file helps you when you work in a strict rebase-then-merge git policy environment. This would essentially keep the chronology of your commits even after they are rebased.
#!/bin/sh
set -e
changes=`git status -s | grep -v "??" | wc -l`
if [ "$changes" -gt "0" ]; then
echo "found $changes local changes. stashing them."
git stash
fi
current_branch=`git branch | grep '*' | cut -d ' ' -f2`
echo "update develop from origin"
git pull origin develop:develop
@yeuser
yeuser / merge-repo-as-subdir.sh
Last active September 10, 2020 13:55
Merging one git repository into another repository
#!/bin/bash
if [[ $# -lt 3 ]] ; then
echo "Usage: merge-my-repos <sub_directory> <path_to_repo> <prefix_for_tags>"
exit 1
fi
DIR=$1
REPO=$2
TAG_PREFIX=$3