Skip to content

Instantly share code, notes, and snippets.

@steve-jansen
steve-jansen / git-update
Created March 8, 2013 16:29
A custom script for git to stash any working changes, checkout master, pull origin master, checkout your working branch, rebase master, and unstash your working changes
#!/bin/bash
stash() {
# check if we have uncommited changes to stash
git status --porcelain | grep "^." >/dev/null;
if [ $? -eq 0 ]
then
if git stash save -u "git-update on `date`";
then
@steve-jansen
steve-jansen / git-diff-add
Last active September 19, 2018 21:37
A custom script for git to interactively run "git difftool" against each modified and untracked file, then prompt to stage (add) the change, undo (checkout) the change, or ignore (skip) the change.
#!/bin/bash
# query the root of the repo because git status prints
# relative paths within the repo
if ! pushd "`git rev-parse --show-toplevel`" >/dev/null
then
echo "git rev-parse --show-toplevel failed to return the root dir of the repo"
exit 1
else
gitroot=`pwd`
@steve-jansen
steve-jansen / MsDepSvc.Port.cmd
Created February 28, 2013 21:37
Windows batch script to modify the TCP/IP port binding for the Microsoft Web Deployment Agent Service
:: Name: MsDepSvc.Port.cmd
:: Purpose: Modifies the TCP/IP port that the Web Deployment Agent Service
:: (MsDepSvc) listens on. Tested on Win7 Enterprise 32-bit.
:: Author: stevejansen_github@icloud.com
:: Revision: January 2013
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION