diff options
author | typebrook <typebrook@gmail.com> | 2020-03-17 10:10:23 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-03-17 15:43:35 +0800 |
commit | ccf58020586f920fdc093f68599c754e96a976ef (patch) | |
tree | ee69761db2a6e1eec1ce1a88d51d28da8cc79fc5 | |
parent | f2fd34a565808d3d5f0ea714b2a1a3cca3135cfa (diff) |
Update README
-rw-r--r-- | README.md | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -134,8 +134,11 @@ valid values are: | |||
134 | For example, use `gist config protocol ssh` to use SSH protocol instead. | 134 | For example, use `gist config protocol ssh` to use SSH protocol instead. |
135 | 135 | ||
136 | ## Tips | 136 | ## Tips |
137 | ### Git Branching | ||
138 | Each gist is a git repository. Although there are some limits on `git push`, like sub-directory. But guess what? Push another branch to `github.com` is allowed. So why not use this feature for your gist workflow? | ||
139 | |||
137 | ### Jump to gist repo | 140 | ### Jump to gist repo |
138 | Sometimes you want to switch to the specified gist repo as working directory. | 141 | Sometimes you want to switch to the gist repo as working directory with given index. |
139 | But since `gist` is a bash script which goes in subshell, if you want to achieve this, it is necessary to configure shell setting by yourself. | 142 | But since `gist` is a bash script which goes in subshell, if you want to achieve this, it is necessary to configure shell setting by yourself. |
140 | 143 | ||
141 | `gist <index-of-gist>` will return the path of repo, so you can put the following function into your `~/.bashrc` or `~/.zshrc` to apply it. | 144 | `gist <index-of-gist>` will return the path of repo, so you can put the following function into your `~/.bashrc` or `~/.zshrc` to apply it. |
@@ -147,6 +150,26 @@ But since `gist` is a bash script which goes in subshell, if you want to achieve | |||
147 | ``` | 150 | ``` |
148 | And run `cdgist 3` to jump to the repo of your third gist. | 151 | And run `cdgist 3` to jump to the repo of your third gist. |
149 | 152 | ||
153 | ### Suppress hint | ||
154 | If [action](#action) is not configured, there is always a hint to show how to configure it. The following command can suppress it with a simple action that does nothing. | ||
155 | ``` | ||
156 | gist config action 'true' | ||
157 | ``` | ||
158 | |||
159 | There are serveral environment variables can suppress hint or user confirm, like: | ||
160 | ``` | ||
161 | # show list without hint | ||
162 | hint=false gist | ||
163 | |||
164 | # just print the repo path with a given index | ||
165 | gist 3 --no-action | ||
166 | |||
167 | # delete your third gist without confirmation | ||
168 | confirm=false gist delete 3 | ||
169 | ``` | ||
170 | |||
171 | |||
172 | |||
150 | ### Useful action for gist repo | 173 | ### Useful action for gist repo |
151 | I strongly recommend using [`tig`](https://github.com/jonas/tig) as [action](#action). It is the most powerful git CLI tool as far as I know, and also easy to get in most of the Linux distros or Homebrew for mac. Give it a try! | 174 | I strongly recommend using [`tig`](https://github.com/jonas/tig) as [action](#action). It is the most powerful git CLI tool as far as I know, and also easy to get in most of the Linux distros or Homebrew for mac. Give it a try! |
152 | 175 | ||