Skip to content

Instantly share code, notes, and snippets.

@nikreiman
Created January 20, 2012 10:00
Show Gist options
  • Save nikreiman/1646513 to your computer and use it in GitHub Desktop.
Save nikreiman/1646513 to your computer and use it in GitHub Desktop.
My git merging flow: fetch, incoming, review, merge
# Show incoming commits on the current branch that have yet to be merged.
# This function should be run directly after fetching.
function incoming() {
local branch=$1
if [ -z "$branch" ] ; then
branch=$(git-branch-current)
fi
git --no-pager log origin/$branch ^$branch
}
# Simple code review for incoming changes. After fetching, run this function
# to walk through each change, newest to oldest.
function review() {
local branch=$(git-branch-current)
local response=
for i in $(git --no-pager log --format="%h" origin/$branch ^$branch) ; do
clear
git show $i
read -p "Press any key to continue " response
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment