Skip to content

Instantly share code, notes, and snippets.



Last active Jul 22, 2020
What would you like to do?
how to tell yourself when you need to merge with master / integration when you are working on a feature branch

this will work on linux where notify-send is installed

throw this snippet into ~/.bashrc



    if ! git rev-parse --verify dev 2> /dev/null; then

	fetch_output="$(git fetch origin "$branch_name" 2> /dev/null)"

	if [[ -n "$fetch_output" ]]; then
	   notify-send  \
		--urgency=CRITICAL 'git merge info' "You may need to merge with the upstream for repo: '$(pwd)'"

) &> /dev/null & ) &> /dev/null 

the default integration branch is "dev", if "dev" doesnt exist we fallback to master. It will send a notification to the desktop if there are new commits that haven't been fetched before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment