Skip to content

Instantly share code, notes, and snippets.

View quickshiftin's full-sized avatar

Nathan Nobbe quickshiftin

View GitHub Profile
@quickshiftin
quickshiftin / git-transmit
Last active January 1, 2020 16:00 — forked from subtleGradient/git-transmit
Checkout this approach for knowing what to transfer. This revision uses a local tag to track each time you use the command. The first time you use it, it pushes all files in the project. At the end of each run it updates the tag to point to HEAD. Next time you run it, it will only push files that have changed since the last push.
#!/usr/bin/env bash
# author: Thomas Aylott SubtleGradient.com
# author: Nathan Nobbe quickshiftin.com
# Find out where HEAD is pointing
head_ref=$(git show-ref --head -s | head -n 1)
# Check to see if transmit tag exists, and get transmit tag hash
_transmit_ref=$(git show-ref --verify -s refs/tags/transmit)
# If there's not transmit tag, create it for the first time.