Skip to content

Instantly share code, notes, and snippets.

@hoandang
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoandang/9801731 to your computer and use it in GitHub Desktop.
Save hoandang/9801731 to your computer and use it in GitHub Desktop.
Useful custom commands
Delete remote branch
git push origin :<remote-branch-name>
Git diff 2 branches
git diff --stat --color <branch1>..<branch2> 
or
git diff --name-status <branch1>..<branch2>
View full screen in alfred
Press cmd + l
Manipulate file content
sed -i.bu 's/<search>/<replace>/g' <target_file> // Replace content
sed '/<pattern_to_match>/d' <target_file> > <output_file> // Delete line content word
Search file content
grep <pattern_to_match> <target_file>
Desc a table in sqlite
pragma table_info(<table_name>);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment