about summary refs log tree commit diff stats
path: root/dev/git/work.html
diff options
context:
space:
mode:
Diffstat (limited to 'dev/git/work.html')
-rw-r--r--dev/git/work.html69
1 files changed, 35 insertions, 34 deletions
diff --git a/dev/git/work.html b/dev/git/work.html
index 3111eaf..724df1c 100644
--- a/dev/git/work.html
+++ b/dev/git/work.html
@@ -10,58 +10,58 @@
 
     <h1>1. Work</h1>
 
-    <p>Git is very easy to use and very useful to keep information in text or other formats. To start using just go to a directory where you will test git, add some files and;
+    <p id="init">Git is very easy to use and very useful to keep information in text or other formats. To start using just go to a directory where you will test git, add some files and;
 
     <pre>
-$ git init
+    $ git init
     </pre>
 
-    <p>This initiates git directory and configuration files for this repository, you can see new directory ".git/". The next command says the status of your working directory, since no files have been added it will report "untracked files";</p>
+    <p id="status">This initiates git directory and configuration files for this repository, you can see new directory ".git/". The next command says the status of your working directory, since no files have been added it will report "untracked files";</p>
 
     <pre>
-$ git status
+    $ git status
     </pre>
 
-    <p>Add all files to start tracking them;</p>
+    <p id="add">Add all files to start tracking them;</p>
 
     <pre>
-$ git add .
+    $ git add .
     </pre>
 
     <p>Run again git status, it should report that new files have been added;</p>
 
     <pre>
-$ git status
+    $ git status
     </pre>
 
-    <p>If you change any file it will report that the file have been changed at this moment, new changes can be added to current state of the files for the next commit. To commit;</p>
+    <p id="commit">If you change any file it will report that the file have been changed at this moment, new changes can be added to current state of the files for the next commit. To commit;</p>
 
     <pre>
-$ git commit -m "initial commit"
+    $ git commit -m "initial commit"
     </pre>
 
     <h2 id="local">2.1. Local workflow</h2>
 
-    <p>Check ~/.bashrc for glog alias, help to check branches and their commit history;</p>
+    <p id="log">Check ~/.bashrc for glog alias, help to check branches and their commit history;</p>
 
     <pre>
-# Git log
-glog () {
-    git log --stat --decorate
-}
-# Git graph log
-gloga () {
-    git log --graph --abbrev-commit --decorate --date=relative --all
-}
+    # Git log
+    glog () {
+        git log --stat --decorate
+    }
+    # Git graph log
+    gloga () {
+        git log --graph --abbrev-commit --decorate --date=relative --all
+    }
     </pre>
 
-    <p>Mark all deleted to commit;</p>
+    <p id="ls-files">Mark all deleted to commit;</p>
 
     <pre>
     $ git ls-files --deleted -z | xargs -0 git rm
     </pre>
 
-    <p>Query last commit that affected current file path</p>
+    <p id="rev-list">Query last commit that affected current file path</p>
 
     <pre>
     $ git rev-list -n 1 HEAD -- .
@@ -69,7 +69,7 @@ gloga () {
     $ git diff --name-status f000 path/to/file
     </pre>
 
-    <p>Undo a file to specific commit</p>
+    <p id="checkout">Undo a file to specific commit</p>
 
     <pre>
     $ git checkout f000^ -- path/to/file
@@ -82,7 +82,7 @@ gloga () {
     $ git rebase -i oldest_commit_to_rewrite
     </pre>
 
-    <p>Undo last commit;</p>
+    <p id="reset">Undo last commit;</p>
 
     <pre>
     $ git reset --soft HEAD~1
@@ -90,7 +90,7 @@ gloga () {
 
     <h2 id="logdiff">2.2. Logs, diff commits</h2>
 
-    <p>Create patch files to target branch/tag/ref;</p>
+    <p id="format-patch">Create patch files to target branch/tag/ref;</p>
 
     <pre>
     $ git format-patch --no-prefix software-v0.0.1
@@ -110,37 +110,37 @@ gloga () {
     $ git remote add newremotename https://machine.example.org/repo.git
     </pre>
 
-    <p>Update all branches with remote;</p>
+    <p>Update local branches removed on remote set automatically;</p>
 
     <pre>
-    $ git fetch --all
-    $ git pull --all
+    $ git config --global fetch.prune true
     </pre>
 
-    <p>If you want to track all remotes run this line
-    and then the commands mentioned above;</p>
+    <p>This will prune on fetch or you can keep it manually;</p>
 
     <pre>
-    $ for remote in `git branch -r`; do git branch --track ${remote#origin/} $remote; done
+    $ git remote prune origin
     </pre>
 
-    <p>Future updates;</p>
+    <p id="fetch">Update all branches with remote;</p>
 
     <pre>
     $ git fetch --all
     $ git pull --all
     </pre>
 
-    <p>Update local branches removed on remote set;</p>
+    <p>If you want to track all remotes run this line
+    and then the commands mentioned above;</p>
 
     <pre>
-    $ git config --global fetch.prune true
+    $ for remote in `git branch -r`; do git branch --track ${remote#origin/} $remote; done
     </pre>
 
-    <p>This will prune on fetch or you can keep it manually;</p>
+    <p>Future updates;</p>
 
     <pre>
-    $ git remote prune origin
+    $ git fetch --all
+    $ git pull --all
     </pre>
 
     <p>When using gitolite as remote, check following documentation;</p>
@@ -161,6 +161,7 @@ gloga () {
     </ul>
 
     <a href="index.html">Git Index</a>
+
     <p>This is part of the Hive System Documentation.
     Copyright (C) 2019
     Hive Team.
tle='Blame the previous revision' href='/punk/doc/blame/tools/mutt.html?id=bcc4fcdffbf886743838392034d1b037bc28a864'>^
07bedee ^
9741df0 ^
07bedee ^





9741df0 ^
07bedee ^

















9741df0 ^

07bedee ^







9741df0 ^
07bedee ^
9741df0 ^
07bedee ^



































9741df0 ^
07bedee ^































9741df0 ^
07bedee ^







9741df0 ^
07bedee ^










9741df0 ^
07bedee ^








9741df0 ^
07bedee ^


183caad ^
07bedee ^

07bedee ^

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