-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
212 lines (207 loc) · 5.36 KB
/
app.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
(function() {
var app = angular.module('gitBasics', []);
app.controller('CommandController', function(){
this.title = 'Git Basics';
this.subtitle = 'Basic commands to use with Git';
this.basics = [
// git help
{
title: 'Help',
description: 'Get help for git commands',
command: 'git help',
commands: [
{
command: 'git help',
description: 'get general help'
},
{
command: 'git help config',
description: 'get help for config command'
},
{
command: 'git help commit',
description: 'get help for commit command'
}
]
},
// git init
{
title: 'Init',
description: 'Create a new git repo',
command: 'git init'
},
// git status
{
title: 'Status',
description: 'Show the modified files and file on stage and the actual branch',
command: 'git status'
},
// git diff
{
title: 'Diff',
description: 'Show the diff between files',
command: 'git diff',
commands: [
{
command: 'git diff',
description: "show all file's change from the last commit"
},
{
command: 'git diff file_name',
description: "show the file's change from the last commit"
},
{
command: 'git diff --staged',
description: "show all file's change on the stage"
}
]
},
// git reset
{
title: 'Reset',
description: 'Remove files from stage / undo changes / undo commits',
command: 'git reset',
commands: [
{
command: 'git reset file_name',
description: "remove file from stage"
},
{
command: 'git reset --soft HEAD^',
description: "undo last commit, but keep changes"
},
{
command: 'git reset --hard HEAD^',
description: "undo last commit, and discart changes"
}
]
},
// git add
{
title: 'Add',
description: 'Add files to stage',
command: 'git add',
commands: [
{
command: 'git add file_name',
description: 'add file_name to stage'
},
{
command: 'git add directory',
description: "add directory and all it's files/diretories to stage"
},
{
command: 'git add .',
description: 'add all changed files/directories to stage'
}
]
},
// git checkout
{
title: 'Checkout',
description: 'work with files history and switch branches',
command: 'git checkout',
commands: [
{
command: 'git checkout -- file_name',
description: "discart file's change on stage"
},
{
command: 'git checkout branch_name',
description: "switch to branch"
},
{
command: 'git checkout -b new-branch',
description: "create and switch to new-branch"
},
]
},
// git push
{
title: 'Push',
description: 'Send commits to remote repository',
command: 'git push',
commands: [
{
command: 'git push',
description: "send all commits from all tracking branches to the default remote repository"
},
{
command: 'git push origin master',
description: "send all commits to the 'origin' remote in the 'master' branch"
},
{
command: 'git push -u origin master',
description: "send all commits to the 'origin' remote in the 'master' branch and set it as default"
},
]
},
// git pull
{
title: 'Pull',
description: 'Get commits and branches from remote repository',
command: 'git pull',
},
// git ammend
{
title: 'Amend',
description: 'Add stage files to the last commit',
command: 'git --amend',
commands: [
{
command: 'git --amend',
description: 'add stage files to the last commit and keep the message'
},
{
command: "git --amend -m 'New commit message'",
description: 'add stage files to the last commit and change the message'
}
]
},
// git branch
{
title: 'Branch',
description: 'Create, list and delete branches',
command: 'git branch',
commands: [
{
command: 'git branch --list',
description: "list all branches"
},
{
command: 'git branch new-branch',
description: "create a branch named new-branch"
},
{
command: 'git branch -d new-branch',
description: "delete the new-branch"
},
]
},
// git clone
{
title: 'Clone',
description: 'Clone a remote repository',
command: 'git clone',
commands: [
{
command: 'git clone [email protected]:wwwbruno/git-basics.git',
description: "clone this resposiory via ssh in a directory git-basics (need ssh key configured)"
},
{
command: 'git clone [email protected]:wwwbruno/git-basics.git new-directory',
description: "clone this resposiory via ssh in a directory new-directory (need ssh key configured)"
},
{
command: 'git clone https://github.com/wwwbruno/git-basics.git',
description: "clone this resposiory via https in a directory git-basics"
},
{
command: 'git clone https://github.com/wwwbruno/git-basics.git new-directory',
description: "clone this resposiory via https in a directory new-directory"
},
]
},
];
});
})();