Skip to content

Instantly share code, notes, and snippets.

View Sanne's full-sized avatar

Sanne Grinovero Sanne

View GitHub Profile
@Sanne
Sanne / git-deep-prune.sh
Created July 11, 2012 14:24
git-deep-prune
#!/bin/bash
# Script to loop on local and remote branches, to delete all those which are
# already merged in master.
# Assumes "origin" and "master" are your references: replace all occurrences
# of "origin" with the name of your personal remote.
#
# Careful with branches which should are meant as tags in the past!
#
# Inspired from http://devblog.springest.com/a-script-to-remove-old-git-branches
# Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/
@Sanne
Sanne / git-pull
Created May 3, 2012 12:24
Send a pull request from command line
#!/bin/bash
# Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/
#
# Copyright (c) 2012 Sanne Grinovero
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/"
}
function git_project_id {
@Sanne
Sanne / git-inspect
Created April 26, 2012 17:40
See differences between current branch and master [other branch]
#!/bin/bash
# Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/
# Copyright (c) 2012 Sanne Grinovero
if [[ $# -eq 0 ]]; then
rm -f *.patch && git format-patch -M80% -C80% master && gedit -w -s *.patch && rm *.patch
else
rm -f *.patch && git format-patch -M80% -C80% "$@" && gedit -w -s *.patch && rm *.patch
fi
@Sanne
Sanne / gitconfig
Last active September 27, 2015 11:48
gitconfig
[core]
editor = gedit
[merge]
tool = meld
[color]
ui = yes
[color "branch"]
current = yellow reverse
local = yellow
remote = green
@Sanne
Sanne / jira
Last active September 26, 2015 10:57
Open JIRA from git branch
#!/bin/bash
# This script will look into the GIT commit log of the current directory, backwards since the branch
# from master, searching for references to JIRA issues of a set of known projects.
# It will then print URLs to all mentioned JIRA issues.
# Optionally (uncommnent one line) it could open all relevant issues in different tabs of a browser: this is useful
# in my workflow as I often want to comment and/or close the issues when merging work in upstream.
#
# Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/
#
# Copyright (c) 2011 Sanne Grinovero
@Sanne
Sanne / build.sh
Last active February 11, 2021 09:04 — forked from emmanuelbernard/build.sh
Build script
#!/bin/bash
# run ./build.sh
# it will clone your existing repo and run the maven tests off this clone
# the branch tests are run from is the current branch at the time of cloning
#
# Note that you can work on the next bug while this is going on
#
# ./build.sh
# runs maven clean install
#