Skip to content

Instantly share code, notes, and snippets.

View pfaffman's full-sized avatar

Jay Pfaffman pfaffman

View GitHub Profile
@RickyCook
RickyCook / rsync.yaml
Created October 27, 2014 05:45
Ansible rsync changed status
# Uses the rsync change summary to figure out how many things changed, and uses that
# to tell Ansible if something changed or not
- name: sync hieradata
shell: rsync --delete -ri "/tmp/repo/hieradata" "/etc/puppet/hieradata" | awk '{print $1}' | grep -vE '..\.\..\.\.\.\.' | wc -l
register: hieradata_changes
changed_when: "hieradata_changes.stdout|int != 0"
@tkersey
tkersey / Undo a commit and redo
Created October 8, 2010 22:36
Git: undo a commit and redo
http://stackoverflow.com/questions/927358/git-undo-last-commit
Undo a commit and redo
$ git commit ...
$ git reset --soft HEAD^ (1)
$ edit (2)
$ git commit -a -c ORIG_HEAD (3)
This is most often done when you remembered what you just committed is incomplete, or you misspelled your commit message, or both. Leaves working tree as it was before "reset".