Skip to content

Instantly share code, notes, and snippets.

View tanshuai's full-sized avatar
👨‍💻
Coding for dream

Tan Shuai tanshuai

👨‍💻
Coding for dream
View GitHub Profile
@tanshuai
tanshuai / GIF-Screencast-OSX.md
Created October 27, 2021 01:39 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@tanshuai
tanshuai / delete-remote-tags-git-pattern.md
Last active October 27, 2021 01:44
Delete Remote Tags on Git by Pattern

For example, delete all remote tags with name prefix builds (build-xxx, buildxxx...):

git fetch --tags --all 
git push -d origin $(git tag -l "build*")
git tag -d $(git tag -l "build*")
@tanshuai
tanshuai / git-list-branches-creator-name-email.md
Created October 23, 2021 09:21
List all branches of git repo with creator name and email
git for-each-ref --format='%(committerdate) %09 %(authorname) %(authoremail) %09 %(refname)' --sort=committerdate
@tanshuai
tanshuai / delete-all-branches-keep-main.md
Last active October 23, 2021 08:46
Delete all the local branches but keep main
git branch | grep -v "main" | xargs git branch -D
@tanshuai
tanshuai / git-replace-committer-email.sh
Created August 14, 2021 04:25
Replace/modify committer name & email of all Git historical commits
#!/bin/sh
# Replace/modify committer name & email of all Git historical commits
# git-replace-committer-email.sh v1 git@tanshuai.com
# Usage:
# cd <git repo>
# sh ../git-replace-committer-email.sh
# git push --force --tags origin HEAD:main
git filter-branch -f --env-filter '