This repository has been archived by the owner on May 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
/
README
287 lines (264 loc) · 11.2 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
Archived, abandoned
===================
git-spindle was once born because GitLab and BitBucket didn't have usable CLI's, and GitHub's cli
left much to be desired. These days GitHub's `gh` beats git-spindle by a mile, and for GitLab
there's `glab`. Even atlassian now ships a cli for bitbucket, though personally I don't care about
bitbucket at all anymore.
So it's time for git-spindle to retire. It was fun while it lasted, and if there's some code in here
you find useful, feel free to steal it as you see fit.
Integrating git with central services
=====================================
Many central git hosting services, such as GitHub and GitLab, provide an API to
perform actions such as creating repositories and filing pull requests.
git-spindle is a collection of git subcommands to make using these services
easier.
For example, to fork and clone a repository on GitHub, one can now simply use
git hub clone seveas/whelk
With this git subcommand, you can perform various github actions, such as
creating or forking a repository from the command line.
To install the latest released version on Ubuntu:
sudo add-apt-repository ppa:dennis/python
sudo add-apt-repository ppa:dennis/devtools
sudo apt-get update
sudo apt-get install git-spindle
To install the latest released version on Windows:
Install git from http://git-for-windows.github.io/
Install python 3.5 or newer from https://www.python.org/downloads/
Run the following 2 commands in a command prompt:
py -mensurepip
py -mpip install git-spindle
To install the latest released version on other systems, assuming python and
pip are installed:
pip install git-spindle
Usage:
(For detailed information, go to https://git-spindle.seveas.net)
Add an account to the configuration:
git hub add-account [--host=<host>] <alias>
Add a user as collaborator:
git hub add-collaborator <user>...
Add a deploy key:
git hub add-deploy-key [--read-only] <key>...
Add a repository hook:
git hub add-hook <name> [<setting>...]
Adds keys to your public keys:
git hub add-public-keys [<key>...]
Add user's fork as a named remote. The name defaults to the user's loginname:
git hub add-remote [--ssh|--http|--git] <user> [<name>]
Applies a pull request as a series of cherry-picks:
git hub apply-pr <pr-number>
Open the GitHub page for a repository in a browser:
git hub browse [--parent] [<repo>] [<section>]
Show a timeline of a user's activity:
git hub calendar [<user>]
Display the contents of a file on GitHub:
git hub cat <file>...
Check the github pages configuration and content of your repo:
git hub check-pages [<repo>] [--parent]
Clone a repository by name:
git hub clone [--ssh|--http|--git] [--triangular [--upstream-branch=<branch>]] [--parent] [git-clone-options] <repo> [<dir>]
List collaborators of a repository:
git hub collaborators [<repo>]
Configure git-spindle, similar to git-config:
git hub config [--unset] <key> [<value>]
Create a repository on github to push to:
git hub create [--private] [--org=<org>] [--description=<description>]
Create a personal access token that can be used for git operations:
git hub create-token [--store]
Lists all keys for a repo:
git hub deploy-keys [<repo>]
Edit a hook:
git hub edit-hook <name> [<setting>...]
Fetch refs from a user's fork:
git hub fetch [--ssh|--http|--git] <user> [<refspec>]
Fork a repo and clone it:
git hub fork [--ssh|--http|--git] [--triangular [--upstream-branch=<branch>]] [<repo>]
List all forks of this repository:
git hub forks [<repo>]
Create a new gist from files or stdin:
git hub gist [--description=<description>] <file>...
Show all gists for a user:
git hub gists [<user>]
Show hooks that have been enabled:
git hub hooks
Show gitignore patterns for one or more languages:
git hub ignore [<language>...]
Show the IP addresses for github.com services in CIDR format:
git hub ip-addresses [--git] [--hooks] [--importer] [--pages]
Show issue details or report an issue:
git hub issue [<repo>] [--parent] [<issue>...]
List issues in a repository:
git hub issues [<repo>] [--parent] [<filter>...]
Display github log for yourself or other users. Or for an organisation or a repo:
git hub log [--type=<type>] [--count=<count>] [--verbose] [<what>]
Display the contents of a directory on GitHub:
git hub ls [<dir>...]
Mirror a repository, or all repositories for a user:
git hub mirror [--ssh|--http|--git] [<repo>]
Create a graphviz graph of followers and forks:
git hub network [<level>]
Protect a branch against deletions, force-pushes and failed status checks:
git hub protect [--enforcement-level=<level>] [--contexts=<contexts>] <branch>
List active branch protections:
git hub protected
Lists all keys for a user:
git hub public-keys [<user>]
Opens a pull request to merge your branch to an upstream branch:
git hub pull-request [--issue=<issue>] [--yes] [<yours:theirs>]
Get the README for a repository:
git hub readme [<repo>]
Create a release:
git hub release [--draft] [--prerelease] <tag> [<releasename>]
List all releases:
git hub releases [<repo>]
Remove a user as collaborator:
git hub remove-collaborator <user>...
Remove deploy key by id:
git hub remove-deploy-key <key>...
Remove a hook:
git hub remove-hook <name>
Render a markdown document:
git hub render [--save=<outfile>] <file>
List all repos of a user, by default yours:
git hub repos [--no-forks] [<user>]
Let the octocat speak to you:
git hub say [<msg>]
Set the remote 'origin' to github.:
git hub set-origin [--ssh|--http|--git] [--triangular [--upstream-branch=<branch>]]
Display current and historical GitHub service status:
git hub status
Remove branch protections from a branch:
git hub unprotect <branch>
Display GitHub user info:
git hub whoami
Display GitHub user info:
git hub whois <user>...
Add an account to the configuration:
git lab add-account [--host=<host>] <alias>
Add a project member:
git lab add-member [--access-level=guest|reporter|developer|master|owner] <user>...
Adds keys to your public keys:
git lab add-public-keys [<key>...]
Add user's fork as a named remote. The name defaults to the user's loginname:
git lab add-remote [--ssh|--http] <user> [<name>]
Applies a merge request as a series of cherry-picks:
git lab apply-merge <merge-request-number>
Open the GitLab page for a repository in a browser:
git lab browse [--parent] [<repo>] [<section>]
Show a timeline of a user's activity:
git lab calendar [<user>]
Display the contents of a file on GitLab:
git lab cat <file>...
Clone a repository by name:
git lab clone [--ssh|--http] [--triangular [--upstream-branch=<branch>]] [--parent] [git-clone-options] <repo> [<dir>]
Configure git-spindle, similar to git-config:
git lab config [--unset] <key> [<value>]
Create a repository on gitlab to push to:
git lab create [--private|--internal] [--group=<group>] [--description=<description>]
Fetch refs from a user's fork:
git lab fetch [--ssh|--http] <user> [<refspec>]
Fork a repo and clone it:
git lab fork [--ssh|--http] [--triangular [--upstream-branch=<branch>]] [<repo>]
Show issue details or report an issue:
git lab issue [<repo>] [--parent] [<issue>...]
List issues in a repository:
git lab issues [<repo>] [--parent] [<filter>...]
Display GitLab log for a repository:
git lab log [<repo>]
Display the contents of a directory on GitLab:
git lab ls [<dir>...]
List repo memberships:
git lab members [<repo>]
Opens a merge request to merge your branch to an upstream branch:
git lab merge-request [--yes] [<yours:theirs>]
Mirror a repository, or all your repositories:
git lab mirror [--ssh|--http] [<repo>]
Protect a branch against force-pushes:
git lab protect <branch>
List protected branches:
git lab protected
Lists all keys for a user:
git lab public-keys [<user>]
Remove a user's membership:
git lab remove-member <user>...
List all your repos:
git lab repos [--no-forks]
Set the remote 'origin' to gitlab.:
git lab set-origin [--ssh|--http] [--triangular [--upstream-branch=<branch>]]
Remove force-push protection from a branch:
git lab unprotect <branch>
Display GitLab user info:
git lab whoami
Display GitLab user info:
git lab whois <user>...
Add an account to the configuration:
git bb add-account <alias>
Add a deploy key:
git bb add-deploy-key <key>...
Add privileges for a user to this repo:
git bb add-privilege [--admin|--read|--write] <user>...
Adds keys to your public keys:
git bb add-public-keys [<key>...]
Add user's fork as a named remote. The name defaults to the user's loginname:
git bb add-remote [--ssh|--http] <user> [<name>]
Applies a pull request as a series of cherry-picks:
git bb apply-pr <pr-number>
Open the GitHub page for a repository in a browser:
git bb browse [--parent] [<repo>] [<section>]
Display the contents of a file on BitBucket:
git bb cat <file>...
Clone a repository by name:
git bb clone [--ssh|--http] [--triangular [--upstream-branch=<branch>]] [--parent] [git-clone-options] <repo> [<dir>]
Configure git-spindle, similar to git-config:
git bb config [--unset] <key> [<value>]
Create a repository on bitbucket to push to:
git bb create [--private] [--team=<team>] [--description=<description>]
Lists all keys for a repo:
git bb deploy-keys [<repo>]
Fetch refs from a user's fork:
git bb fetch [--ssh|--http] <user> [<refspec>]
Fork a repo and clone it:
git bb fork [--ssh|--http] [--triangular [--upstream-branch=<branch>]] [<repo>]
List all forks of this repository:
git bb forks [<repo>]
Invite users to collaborate on this repository:
git bb invite [--read|--write|--admin] <email>...
Show issue details or report an issue:
git bb issue [<repo>] [--parent] [<issue>...]
List issues in a repository:
git bb issues [<repo>] [--parent] [<filter>...]
Display the contents of a directory on BitBucket:
git bb ls [<dir>...]
Mirror a repository, or all repositories for a user:
git bb mirror [--ssh|--http] [<repo>]
List repo privileges:
git bb privileges [<repo>]
Lists all keys for a user:
git bb public-keys [<user>]
Opens a pull request to merge your branch to an upstream branch:
git bb pull-request [--yes] [<yours:theirs>]
Remove deploy key by id:
git bb remove-deploy-key <key>...
Remove a user's privileges:
git bb remove-privilege <user>...
List all repos of a user, by default yours:
git bb repos [--no-forks] [<user>]
Set the remote 'origin' to github.:
git bb set-origin [--ssh|--http] [--triangular [--upstream-branch=<branch>]]
Create a new snippet from files or stdin:
git bb snippet [--description=<description>] <file>...
Show all snippets for a user:
git bb snippets [<user>]
Display BitBucket user info:
git bb whoami
Display GitHub user info:
git bb whois <user>...
Copyright (C) 2012-2020 Dennis Kaarsemaker <[email protected]>
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.