-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata-en.js
412 lines (379 loc) · 12.2 KB
/
data-en.js
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
/*
json array with git commands data
categories:
init
stage area
diff
stash
commit
pull
push
branch
merge
rebase
tag
log
config
internals
*/
var data_en =
[
// init
{
"title": "Initialize a repository",
"text_1": "",
"command_1": "git init [-b <initial_branch_name>]",
"category": "init"
},
{
"title": "Clone a repository",
"text_1": "",
"command_1": "git clone [--recurse-submodules] <repository_link>",
"text_2": "You can also clone a single branch",
"command_2": "git clone -b <branch> --single-branch <repository_link>",
"category": "init"
},
// stage area
{
"title": "Show working directory status",
"text_1": "",
"command_1": "git status [--show-stash] [--verbose] [--ignored]",
"text_2": "You can also inspect the status using the default graphical interface",
"command_2": "gitk [--all]",
"category": "stage area"
},
{
"title": "Add file to stage",
"text_1": "Use -p option to add specific lines of file. It will interactively let you add, skip or split diff hunks",
"command_1": "git add <file> [-p]",
"category": "stage area"
},
{
"title": "Add all files to stage",
"text_1": "",
"command_1": "git add .",
"text_2": "You can also use following command to add all already tracked files",
"command_2": "git add -u",
"category": "stage area"
},
{
"title": "Remove file or folder from stage",
"text_1": "Unstage desired file or folder from the index",
"command_1": "git reset HEAD -- <file | directory>",
"text_2": "or",
"command_2": "git restore --staged <file>",
"category": "stage area"
},
{
"title": "Delete local changes of file",
"text_1": "",
"command_1": "git checkout -- <file>",
"text_2": "or",
"command_2": "git restore <file>",
"text_3": "The experimental restore command does the same thing as the checkout command but focused on file changes",
"category": "stage area"
},
{
"title": "Delete all not staged local changes",
"text_1": "",
"command_1": "git checkout .",
"category": "stage area"
},
{
"title": "Remove untracked files",
"text_1": "You can remove all untracked files with -f option",
"command_1": "git clean [-f [-d] [-x] [-X]] [-n | --dry-run]",
"text_2": "You can also remove directories with the -f -d option",
"text_3": "To remove only ignored files use the -f -X option",
"text_4": "To remove both ignored and non-ignored files use the -f -x option",
"text_5": "With -n option you can preview the damage you'll do",
"category": "stage area"
},
// diff
{
"title": "Show local changes",
"text_1": "To show all local changes, use",
"command_1": "git diff",
"text_2": "To show only staged changes, use",
"command_2": "git diff --cached",
"category": "diff"
},
{
"title": "Compare two commits or branches",
"text_1": "Use the --name-only option to check only which files differ (not the content difference)",
"command_1": "git diff <parameter_1>..<parameter_2> [--name-only] [<path>]",
"text_2": "The parameters can be a branch name or a commit hash",
"text_3": "You can use three dots to find the diff from their common ancestor",
"text_4": "You can also specify a path to check only one file or folder",
"category": "diff"
},
// stash
{
"title": "Save changes to stash",
"text_1": "Useful to clean the working directory but keep current state of changes",
"command_1": "git stash push [-m <message>] [--include-untracked]",
"category": "stash"
},
{
"title": "Recover changes from stash",
"text_1": "Apply is the same of pop, but will not remove stash from list",
"command_1": "git stash (pop | apply) [<stash>]",
"text_2": "You can also recover a single file from stash",
"command_2": "git checkout stash@{<index>} -- <file>",
"category": "stash"
},
{
"title": "List stashes",
"text_1": "List of all stash entries in the format stash@{<index>}",
"command_1": "git stash list",
"category": "stash"
},
// commit
{
"title": "Commit changes",
"text_1": "",
"command_1": "git commit [-m <message>]",
"category": "commit"
},
{
"title": "Undo a commit",
"text_1": "Undo last or specific local commit",
"command_1": "git reset [--soft | --hard] (HEAD~ | <commit_hash>)",
"text_2": "--soft option will keep changes staged and --hard option will delete changes",
"text_3": "For a pushed commit, use",
"command_3": "git push -f origin HEAD^:master",
"category": "commit"
},
{
"title": "Copy commit from another branch",
"text_1": "To get a commit or range of commits, use",
"command_1": "git cherry-pick <commit_hash>[^][..<another_commit_hash>] [--no-commit]",
"text_2": "^ will also include <commit_hash> in the range",
"text_3": "To get all commits from a branch, use",
"command_3": "git cherry-pick ..<branch_name>",
"category": "commit"
},
{
"title": "Recover destroyed commit with hard reset",
"text_1": "",
"command_1": "git reflog\n"
+ "git checkout -b <new_branch_name> <destroyed_commit_hash>",
"category": "commit"
},
{
"title": "Checkout specific commit",
"text_1": "",
"command_1": "git checkout <commit_hash>",
"category": "commit"
},
// pull
{
"title": "Pull changes from remote",
"text_1": "With no given option, git will pull in it's default mode, creating a merge commit",
"command_1": "git pull [--rebase | --ff | --ff-only]",
"text_2": "With --ff-only option, git will only update your branch if it can be fast forwarded",
"text_3": "With --rebase option, git will rebase local changes on top of remote changes",
"text_4": "With --ff option, git will create a merge commit",
"category": "pull"
},
{
"title": "Update changes from all remotes",
"text_1": "The fetch command will download objects and refs from the repository",
"command_1": "git fetch --all [-a | --append] [--dry-run]",
"category": "pull"
},
{
"title": "Pull single file from remote",
"text_1": "After fetch operation, use",
"command_1": "git checkout <remote_name>/<branch_name> -- <file>",
"category": "pull"
},
// push
{
"title": "Add new remote to repository",
"text_1": "To add a new remote repository (usually origin), use",
"command_1": "git remote add <remote_name> <remote_url>",
"text_2": "To verify your new remote list, use",
"command_2": "git remote -V",
"category": "push"
},
{
"title": "Push changes to remote",
"text_1": "Usually, <remote_name> will be origin",
"command_1": "git push [<remote_name>] [--force | --force-with-lease]",
"text_2": "After a rebase operation, use the --force-with-lease flag",
"text_3": "To setup remote branch tracking information to a new local branch, use",
"command_3": "git push -u <remote_name> <remote_branch_name>",
"category": "push"
},
// branch
{
"title": "Create new branch",
"text_1": "",
"command_1": "git checkout -b <new_branch_name>",
"category": "branch"
},
{
"title": "List branches",
"text_1": "",
"command_1": "git branch -vv",
"category": "branch"
},
{
"title": "List branches merged into another",
"text_1": "",
"command_1": "git branch --merged <branch>",
"category": "branch"
},
{
"title": "Change to another branch",
"text_1": "",
"command_1": "git checkout <branch_name>\n",
"text_2": "or",
"command_2": "git switch <branch_name>",
"text_3": "The experimental switch command does the same thing as the checkout command but focused on branch changes",
"category": "branch"
},
{
"title": "Rename a branch",
"text_1": "",
"command_1": "git branch -m [<old_branch_name>] <new_branch_name>",
"category": "branch"
},
{
"title": "Delete branch",
"text_1": "To delete a branch locally, use",
"command_1": "git branch -d [--force] <branch_name>",
"text_2": "To delete a branch remotely, use",
"command_2": "git push origin --delete <branch_name>",
"category": "branch"
},
// merge
{
"title": "Merge branch A into B",
"text_1": "With --no-commit option you can inspect the source before the merge commit",
"command_1": "git checkout B\n"
+ "git merge [--no-commit] [--no-ff] [-m <message>] A",
"text_2": "With --no-ff option, even if fast-forward, git will force creation of a merge commit",
"text_3": "In case of conflict, you can abort the merge",
"command_3": "git merge --abort",
"category": "merge"
},
{
"title": "Choose file version to fix conflict",
"text_1": "",
"command_1": "git checkout --ours <file>",
"text_2": "or",
"command_2": "git checkout --theirs <file>",
"text_3": "then, continue as you would normally merge",
"command_3": "git add <file>\n"
+ "git merge --continue",
"text_4": "You can also use a graphical tool to fix conflicts, like Visual Studio Code and GitKraken",
"category": "merge"
},
// rebase
{
"title": "Rebase branch",
"text_1": "Move commits from branch A to branch B",
"command_1": "git checkout A\ngit rebase B [--autostash]",
"text_2": "with --autostash option, git will create a temporary stash and apply it after the operation ends",
"text_3": "then, fix eventual <file> conflicts and continue as you would normally do",
"command_3": "git add <file>\ngit rebase --continue",
"text_4": "You may need to force push after a rebase",
"category": "rebase"
},
// tag
{
"title": "Create a new tag",
"text_1": "To create an annotated tag, use",
"command_1": "git tag -a <tag_name> -m <message>",
"text_2": "To create a lightweight tag, use",
"command_2": "git tag <tag_name>",
"text_3": "Then, send your tag to remote",
"command_3": "git push origin <tag_name>",
"category": "tag"
},
{
"title": "List all tags",
"text_1": "",
"command_1": "git tag -l [<regex>]",
"category": "tag"
},
{
"title": "Show tag information",
"text_1": "",
"command_1": "git show <tag_name>",
"category": "tag"
},
// log
{
"title": "Visualize repository tree",
"text_1": "Show the one-lined commit tree from all branches of the repository",
"command_1": "git log --decorate --graph --all --oneline",
"text_2": "You can also setup an alias for the above command",
"command_2": "git config alias.<your_alias> 'log --decorate --graph --all --oneline'",
"text_3": "then, use",
"command_3": "git <your_alias>",
"category": "log"
},
{
"title": "Show change history of file",
"text_1": "",
"command_1": "git log [--follow] -p -- <file>",
"text_2": "You can also use the graphical view",
"command_2": "gitk [--follow] <file>",
"category": "log"
},
{
"title": "Search commit log",
"text_1": "",
"command_1": "git log [--all] --grep=<pattern>",
"text_2": "You can also search commits by content changes, using",
"command_2": "git log -S <pattern>",
"category": "log"
},
// config
{
"title": "Configure email and username",
"text_1": "",
"command_1": "git config [--global] user.name <username>"
+ "\ngit config [--global] user.email <email>",
"category": "config"
},
{
"title": "Configure to pull only if fast forward",
"text_1": "",
"command_1": "git config [--global] pull.ff only",
"category": "config"
},
{
"title": "Prevent auto replacing LF with CRLF",
"text_1": "Useful when switching between windows and linux",
"command_1": "git config [--global] core.autocrlf (false | input | true)",
"text_2": "You can also use",
"command_2":"git config [--global] core.filemode (false | true)",
"category": "config"
},
// internals
{
"title": "Stop tracking file changes",
"text_1": "The --assume-unchanged option will prevent detection of changes for that file or folder. You can bring it back to normal with --no-assume-unchanged option",
"command_1": "git update-index [--assume-unchanged | --skip-worktree] <path>",
"text_2": "The --skip-worktree option will keep your own independent version of file or folder. You can bring it back to normal with --no-skip-worktree option",
"category": "internals"
},
{
"title": "Archive a branch",
"text_1": "",
"command_1": "git archive <branch> --format=zip --output=<file>.zip",
"category": "internals"
},
{
"title": "Retrieve a file from repository",
"text_1": "As archive command produces a tar or zip, you need to pipe the output to get the file content",
"command_1": "git archive --remote=<remote_url> (HEAD | <commit_hash>):<path> <file> | tar -x",
"text_2": "The <path> parameter is optional",
"text_3": "Note: Won't work over HTTP, only Git protocol !",
"category": "internals"
},
]