Skip to content

Instantly share code, notes, and snippets.

@kopwei
kopwei / gist:6904021
Created October 9, 2013 16:28
Bash string cutting with delimiter
Pattern Matching
In pattern matching, you can match from the left or from the right. The operators, along with their functions and examples, are shown below:
Operator: ${foo#t*is}
Function: deletes the shortest possible match from the left
Example:
$ export foo="this is a test"
@kopwei
kopwei / Git merge
Created August 8, 2013 10:47
How to merge github branch and local gerrit branch
1) Edit the local .git/config, add the following code:
[remote "github"]
fetch = +refs/heads/*:refs/remotes/github/*
url = git://github.com/PROJ_NAME
2) Check remote branches
git branch -r github