-
Notifications
You must be signed in to change notification settings - Fork 1
/
commits-travel.html
767 lines (672 loc) · 33.2 KB
/
commits-travel.html
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
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="author" content="Gabriel Nakamura" />
<meta name="date" content="2024-07-16" />
<title>Explorando melhor os commits</title>
<script src="site_libs/header-attrs-2.26/header-attrs.js"></script>
<script src="site_libs/jquery-3.6.0/jquery-3.6.0.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="site_libs/bootstrap-3.3.5/css/flatly.min.css" rel="stylesheet" />
<script src="site_libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<style>h1 {font-size: 34px;}
h1.title {font-size: 38px;}
h2 {font-size: 30px;}
h3 {font-size: 24px;}
h4 {font-size: 18px;}
h5 {font-size: 16px;}
h6 {font-size: 12px;}
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
pre:not([class]) { background-color: white }</style>
<script src="site_libs/jqueryui-1.13.2/jquery-ui.min.js"></script>
<link href="site_libs/tocify-1.9.1/jquery.tocify.css" rel="stylesheet" />
<script src="site_libs/tocify-1.9.1/jquery.tocify.js"></script>
<script src="site_libs/navigation-1.1/tabsets.js"></script>
<script src="site_libs/navigation-1.1/codefolding.js"></script>
<script src="site_libs/navigation-1.1/sourceembed.js"></script>
<script src="site_libs/clipboard-1.7.1/clipboard.min.js"></script>
<link href="site_libs/primer-tooltips-1.4.0/build.css" rel="stylesheet" />
<link href="site_libs/klippy-0.0.0.9500/css/klippy.min.css" rel="stylesheet" />
<script src="site_libs/klippy-0.0.0.9500/js/klippy.min.js"></script>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<style type="text/css">
code {
white-space: pre;
}
.sourceCode {
overflow: visible;
}
</style>
<style type="text/css" data-origin="pandoc">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ background-color: #f8f8f8; }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ef2929; } /* Alert */
code span.an { color: #8f5902; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #204a87; } /* Attribute */
code span.bn { color: #0000cf; } /* BaseN */
code span.cf { color: #204a87; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4e9a06; } /* Char */
code span.cn { color: #8f5902; } /* Constant */
code span.co { color: #8f5902; font-style: italic; } /* Comment */
code span.cv { color: #8f5902; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #8f5902; font-weight: bold; font-style: italic; } /* Documentation */
code span.dt { color: #204a87; } /* DataType */
code span.dv { color: #0000cf; } /* DecVal */
code span.er { color: #a40000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #0000cf; } /* Float */
code span.fu { color: #204a87; font-weight: bold; } /* Function */
code span.im { } /* Import */
code span.in { color: #8f5902; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #204a87; font-weight: bold; } /* Keyword */
code span.op { color: #ce5c00; font-weight: bold; } /* Operator */
code span.ot { color: #8f5902; } /* Other */
code span.pp { color: #8f5902; font-style: italic; } /* Preprocessor */
code span.sc { color: #ce5c00; font-weight: bold; } /* SpecialChar */
code span.ss { color: #4e9a06; } /* SpecialString */
code span.st { color: #4e9a06; } /* String */
code span.va { color: #000000; } /* Variable */
code span.vs { color: #4e9a06; } /* VerbatimString */
code span.wa { color: #8f5902; font-weight: bold; font-style: italic; } /* Warning */
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
var sheets = document.styleSheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
try { var rules = sheets[i].cssRules; } catch (e) { continue; }
var j = 0;
while (j < rules.length) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") {
j++;
continue;
}
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') {
j++;
continue;
}
// replace div.sourceCode by a pre.sourceCode rule
sheets[i].deleteRule(j);
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
}
}
})();
</script>
<style type="text/css">
#rmd-source-code {
display: none;
}
</style>
<style type = "text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
img {
max-width:100%;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
details > summary > p:only-child {
display: inline;
}
pre code {
padding: 0;
}
</style>
<style type="text/css">
.dropdown-submenu {
position: relative;
}
.dropdown-submenu>.dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
border-radius: 0 6px 6px 6px;
}
.dropdown-submenu:hover>.dropdown-menu {
display: block;
}
.dropdown-submenu>a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #cccccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
border-left-color: #adb5bd;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left>.dropdown-menu {
left: -100%;
margin-left: 10px;
border-radius: 6px 0 6px 6px;
}
</style>
<script type="text/javascript">
// manage active state of menu based on current page
$(document).ready(function () {
// active menu anchor
href = window.location.pathname
href = href.substr(href.lastIndexOf('/') + 1)
if (href === "")
href = "index.html";
var menuAnchor = $('a[href="' + href + '"]');
// mark the anchor link active (and if it's in a dropdown, also mark that active)
var dropdown = menuAnchor.closest('li.dropdown');
if (window.bootstrap) { // Bootstrap 4+
menuAnchor.addClass('active');
dropdown.find('> .dropdown-toggle').addClass('active');
} else { // Bootstrap 3
menuAnchor.parent().addClass('active');
dropdown.addClass('active');
}
// Navbar adjustments
var navHeight = $(".navbar").first().height() + 15;
var style = document.createElement('style');
var pt = "padding-top: " + navHeight + "px; ";
var mt = "margin-top: -" + navHeight + "px; ";
var css = "";
// offset scroll position for anchor links (for fixed navbar)
for (var i = 1; i <= 6; i++) {
css += ".section h" + i + "{ " + pt + mt + "}\n";
}
style.innerHTML = "body {" + pt + "padding-bottom: 40px; }\n" + css;
document.head.appendChild(style);
});
</script>
<!-- tabsets -->
<style type="text/css">
.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs > li.active:before, .tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "\e259";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "\e258";
font-family: 'Glyphicons Halflings';
border: none;
}
.tabset-dropdown > .nav-tabs > li.active {
display: block;
}
.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
background-color: transparent;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}
.tabset-dropdown > .nav-tabs > li {
display: none;
}
</style>
<!-- code folding -->
<style type="text/css">
.code-folding-btn { margin-bottom: 4px; }
</style>
<style type="text/css">
#TOC {
margin: 25px 0px 20px 0px;
}
@media (max-width: 768px) {
#TOC {
position: relative;
width: 100%;
}
}
@media print {
.toc-content {
/* see https://github.com/w3c/csswg-drafts/issues/4434 */
float: right;
}
}
.toc-content {
padding-left: 30px;
padding-right: 40px;
}
div.main-container {
max-width: 1200px;
}
div.tocify {
width: 20%;
max-width: 260px;
max-height: 85%;
}
@media (min-width: 768px) and (max-width: 991px) {
div.tocify {
width: 25%;
}
}
@media (max-width: 767px) {
div.tocify {
width: 100%;
max-width: none;
}
}
.tocify ul, .tocify li {
line-height: 20px;
}
.tocify-subheader .tocify-item {
font-size: 0.90em;
}
.tocify .list-group-item {
border-radius: 0px;
}
</style>
</head>
<body>
<div class="container-fluid main-container">
<!-- setup 3col/9col grid for toc_float and main content -->
<div class="row">
<div class="col-xs-12 col-sm-4 col-md-3">
<div id="TOC" class="tocify">
</div>
</div>
<div class="toc-content col-xs-12 col-sm-8 col-md-9">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-bs-toggle="collapse" data-target="#navbar" data-bs-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Boas Práticas e Ferramentas da Ciência Aberta na Ecologia - BIE5798</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">Início</a>
</li>
<li>
<a href="intro_ciencia_aberta.html">O que é ciência aberta?</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dados abertos
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="dados_abertos.html">O que são dados abertos?</a>
</li>
<li>
<a href="metadata_EML.html">Metadados</a>
</li>
</ul>
</li>
<li>
<a href="Organizacao_dir_local.html">Organização local</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Versionamento
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="basics_git.html">ABC do versionamento</a>
</li>
<li>
<a href="commits-travel.html">Viajando no tempo</a>
</li>
<li>
<a href="gitgnore.html">Ignorando arquivos</a>
</li>
<li>
<a href="colabs_github.html">Trabalho colaborativo</a>
</li>
<li>
<a href="conflitos.html">Resolvendo conflitos</a>
</li>
<li>
<a href="releasing.html">Release</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Programação letrada
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="rmarkdown-basics.html">Rmarkdown</a>
</li>
<li>
<a href="sites-basics.html">Sites</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Avançado
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="renv-basics.html">Manejo de versões de pacotes</a>
</li>
<li>
<a href="rocker-basics.html">Containers</a>
</li>
<li>
<a href="targets_basics.html">Fluxo de trabalho</a>
</li>
<li>
<a href="metadata_EML_pratice.html">Metadados com EML</a>
</li>
<li>
<a href="git_large_files.html">Manejo de arquivos grandes</a>
</li>
</ul>
</li>
<li>
<a href="publicacoes.html">Acesso aberto</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Outras tendências
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="pre-registro.html">Pré-registro</a>
</li>
<li>
<a href="revisao-codigo.html">Revisão de código</a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
<div id="header">
<div class="btn-group pull-right float-right">
<button type="button" class="btn btn-default btn-xs btn-secondary btn-sm dropdown-toggle" data-toggle="dropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span>Code</span> <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right" style="min-width: 50px;">
<li><a id="rmd-download-source" href="#">Download Rmd</a></li>
</ul>
</div>
<h1 class="title toc-ignore">Explorando melhor os commits</h1>
<h4 class="author">Gabriel Nakamura</h4>
<h4 class="date">2024-07-16</h4>
</div>
<script>
addClassKlippyTo("pre.r, pre.markdown");
addKlippy('left', 'top', 'auto', '1', 'Copy code', 'Copied!');
</script>
<div id="apresentação" class="section level1">
<h1>Apresentação</h1>
<p>Nesta seção iremos explorar um pouco mais o poder que os commits nos
oferecem, incluindo boas práticas para fazer commits nos nossos arquivos
e como “viajar” entre commits passados e presente. Este momento também
servirá para ficarmos um pouco mais familiarizados com o uso do git
através do terminal. Vamos utilizar o teminal visto que algumas coisas
que faremos aqui não podem ser feitas através do RStudio.</p>
<p>Sempre ao fazer commits vale lembrar essas palavras:</p>
<p><img src="figs/commit-safe.png" width="70%" style="display: block; margin: auto;" /></p>
</div>
<div id="workflow-para-os-commits" class="section level1">
<h1>Workflow para os commits</h1>
<p>Em primeiro lugar sempre cheque se está tudo certo com seu
repositório, se seu trabalho local está sincronizado com seu trabalho
remoto. Para tanto pode digitar na linha de comando do terminal</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a>git status</span></code></pre></div>
<p>Se sua <em>working tree</em> estiver no status <em>clean</em>, quer
dizer que você está sincronizada com o <em>origin</em></p>
<p>Faça algumas modificações e depois vamos fazer a mesma sequencia de
ações que fizemos anteriormente (stage, commit, push), mas agora usando
a linha de comando. Para tanto podemos fazer assim</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" tabindex="-1"></a>git add .</span>
<span id="cb2-2"><a href="#cb2-2" tabindex="-1"></a>git commit <span class="sc">-</span>m <span class="st">"uma mensagem informativa"</span></span>
<span id="cb2-3"><a href="#cb2-3" tabindex="-1"></a>git push</span></code></pre></div>
<p>Pronto, fizemos a mesma coisa que anteriormente, mas agora utilizando
o terminal :)</p>
<div id="amend" class="section level2">
<h2>Amend</h2>
<p>Lembra que muitos commits podem te deixar muito lento na escalada? E
poucos commits podem ser pouco informativos caso queira reconstruir o
que aconteceu com o repositório? Pois então, existe uma estratégia
interessante para realizar commits, chamada de <code>amend</code></p>
<p>Em um amend nós basicamente adicionamos um commit a um outro já
existente. Por exemplo, imagine que fez apenas algumas poucas
modificações de código que não necessitam necessariamente de um commit
dedicada exclusivamente para tais, você pode fazer o seguinte:</p>
<p>1 - stage o arquivo que modificou</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" tabindex="-1"></a>git add path<span class="sc">/</span>to<span class="sc">/</span>file</span></code></pre></div>
<p>2 - faça um commit</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" tabindex="-1"></a>git commit <span class="sc">-</span>m <span class="st">"WIP"</span></span></code></pre></div>
<p>Note que coloquei <strong>WIP</strong> neste commit, por que? WIP é
uma sigla usada comumente no versionamente para Working In Progress.
Sempre que tiver um commit desse quer dizer que o commit que fez ainda
está sendo trabalhado.</p>
<p>Ainda não faça o push. Faça mais algumas modificações, e, digamos que
agora fez modificações relevantes no código que merecem um commit
dedicado. Mas lembre-se que o último commit é um WIP. O que fazemos
agora é um amend ao WIP</p>
<p>3 - faça um amend</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" tabindex="-1"></a>git commit <span class="sc">--</span>amend <span class="sc">-</span>m <span class="st">"Aqui um commit com uma mensagem informativa, como sempre"</span></span>
<span id="cb5-2"><a href="#cb5-2" tabindex="-1"></a>git push</span></code></pre></div>
<p>Pronto, agora temos uma mensagem informativa que foi adicionada ao
WIP e não precisamos fazer um push do passo intermediário (WIP),
deixando nossa escalada mais rápida</p>
</div>
<div id="viajando-entre-commits" class="section level2">
<h2>Viajando entre commits</h2>
<p>Uma das maiores potencialidades dos commits é a possibilidade que
podemos navegar entre commits. Ou seja, podemos navegar entre estados
distintos do nosso trabalho a medida que ele é desenvolvido. Podemos
checar esse histórico tanto na nossa página do repositório no GitHub
quanto usando o RStudio, como mostrado na imagem a seguir</p>
<p><img src="figs/github-history.png" width="70%" style="display: block; margin: auto;" /></p>
<p>Para tanto você precisa apenas abrir a aba do Git no RStudio, como
vimos anteriormente, e clicar em <strong>History</strong> no canto
superior esquerdo da janela de revisões. Tudo o que vemos são todos os
commits que foram realizados desde que esse repositório foi formado pela
primeira vez.</p>
</div>
<div id="elementos-importantes-do-commit" class="section level2">
<h2>Elementos importantes do commit</h2>
<p>Alguns elementos presentes no commit são importantes. O principal
deles é a chave SHA-1. Esta se trata de um identificador único do
commit. Com ela podemos viajar entre commits, ou referenciar um dado
commit em uma discussão no github. Por exemplo, supondo que estamos
trabalhando colaborativamente (como nesse site :)), e eu gostei
particularmente mais da versão do site que está há alguns commits atrás.
Uma opção é abrir uma Issue (veremos isso mais tarde), e referenciar
esse número. Ou simplesmente dizer para meu colaborador “Hey dê uma
olhada no commit número XXXXXX”. Na imagem abaixo está em destaque a
chave SHA.</p>
<p><img src="figs/git-sha-key.png" width="70%" style="display: block; margin: auto;" /></p>
<p>Você pode abrir o arquivo no estado em que ele se encontrava em um
dado commit clicando no arquivo modificado naquele commit selecionado.
Por exemplo, digamos que eu queira ver o arquivo chamado
<code>rmarkdown-basics</code> deste site editado dia 02 de Agosto, só
precisamos clicar no arquivo, como mostrado na imagem abaixo:</p>
<p><img src="figs/git-history-file.png" width="70%" style="display: block; margin: auto;" /></p>
</div>
<div id="atividade" class="section level2">
<h2>Atividade</h2>
<p>Explore um pouco os commits que realizaram. Abra a página do github e
também através do Rstudio, veja as diferenças, as vantangens e
desvantagens de cada uma das abordagens</p>
</div>
<div id="throwback-commit" class="section level2">
<h2>Throwback Commit</h2>
<p>Vamos supor que realizamos um commit errado, e agora queremos voltar
ao commit anterior, mas sem perder o trabalho que fizemos nos arquivos.
Para isso podemos usar a abordagem anterior, navegando entre os arquivos
e selecionando o arquivo que queremos em um determinado estado,
substituimos pelo arquivo atual e fazemos um novo commit. Esta opção
pode ser a mais segura se estamos começando a mexer no versionamento.
Outra opção é explorar as funções do git chamadas <code>reset</code>. As
funções reset basicamente move o HEAD do seu diretório para um commit no
passado. Esta abordagem pode causar algumas dores de cabeça no início,
portanto recomendo usa-lá com cautela. Para mais informações sobre isso
dê uma olhada <a
href="https://devconnected.com/how-to-git-reset-to-head/#:~:text=To%20hard%20reset%20files%20to,option%20and%20specify%20the%20HEAD.&text=The%20purpose%20of%20the%20%E2%80%9Cgit,before%20HEAD%20and%20so%20on">nesse
site</a>.)</p>
</div>
</div>
<div id="inutilidades-públicas-necessárias" class="section level1">
<h1>Inutilidades públicas necessárias</h1>
<p>No fim do dia, aprendemos fazer commits apenas para utilizar essa
ferramenta <a href="https://starlogs.dev/">aqui</a>. Cole o link de seu
repositório contendo alguns commits e veja o que acontece</p>
</div>
<div id="rmd-source-code">LS0tDQp0aXRsZTogJ0V4cGxvcmFuZG8gbWVsaG9yIG9zIGNvbW1pdHMnDQphdXRob3I6ICJHYWJyaWVsIE5ha2FtdXJhIg0KZGF0ZTogImByIFN5cy5EYXRlKClgIg0Kb3V0cHV0OiBodG1sX2RvY3VtZW50DQotLS0NCg0KYGBge3Igc2V0dXAsIGluY2x1ZGU9RkFMU0V9DQprbml0cjo6b3B0c19jaHVuayRzZXQoZWNobyA9IFRSVUUsIGZpZy5hbGlnbiA9ICJjZW50ZXIiKQ0KYGBgDQoNCmBgYHtyIGtsaXBweSwgZWNobz1GQUxTRSwgaW5jbHVkZT1UUlVFfQ0Ka2xpcHB5OjprbGlwcHkoKQ0KYGBgDQoNCiMgQXByZXNlbnRhw6fDo28NCg0KTmVzdGEgc2XDp8OjbyBpcmVtb3MgZXhwbG9yYXIgdW0gcG91Y28gbWFpcyBvIHBvZGVyIHF1ZSBvcyBjb21taXRzIG5vcyBvZmVyZWNlbSw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WNhbWVudGUgbW92ZSBvIEhFQUQgZG8gc2V1IGRpcmV0w7NyaW8gcGFyYSB1bSBjb21taXQgbm8gcGFzc2Fkby4gRXN0YSBhYm9yZGFnZW0gcG9kZSBjYXVzYXIgYWxndW1hcyBkb3JlcyBkZSBjYWJlw6dhIG5vIGluw61jaW8sIHBvcnRhbnRvIHJlY29tZW5kbyB1c2EtbMOhIGNvbSBjYXV0ZWxhLiBQYXJhIG1haXMgaW5mb3JtYcOnw7VlcyBzb2JyZSBpc3NvIGTDqiB1bWEgb2xoYWRhIFtuZXNzZSBzaXRlXShodHRwczovL2RldmNvbm5lY3RlZC5jb20vaG93LXRvLWdpdC1yZXNldC10by1oZWFkLyM6fjp0ZXh0PVRvJTIwaGFyZCUyMHJlc2V0JTIwZmlsZXMlMjB0byxvcHRpb24lMjBhbmQlMjBzcGVjaWZ5JTIwdGhlJTIwSEVBRC4mdGV4dD1UaGUlMjBwdXJwb3NlJTIwb2YlMjB0aGUlMjAlRTIlODAlOUNnaXQsYmVmb3JlJTIwSEVBRCUyMGFuZCUyMHNvJTIwb24pLikNCg0KDQojIEludXRpbGlkYWRlcyBww7pibGljYXMgbmVjZXNzw6FyaWFzDQoNCk5vIGZpbSBkbyBkaWEsIGFwcmVuZGVtb3MgZmF6ZXIgY29tbWl0cyBhcGVuYXMgcGFyYSB1dGlsaXphciBlc3NhIGZlcnJhbWVudGEgW2FxdWldKGh0dHBzOi8vc3RhcmxvZ3MuZGV2LykuIENvbGUgbyBsaW5rIGRlIHNldSByZXBvc2l0w7NyaW8gY29udGVuZG8gYWxndW5zIGNvbW1pdHMgZSB2ZWphIG8gcXVlIGFjb250ZWNlDQoNCg==</div>
</div>
</div>
</div>
<script>
// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
$('tr.odd').parent('tbody').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
});
</script>
<!-- tabsets -->
<script>
$(document).ready(function () {
window.buildTabsets("TOC");
});
$(document).ready(function () {
$('.tabset-dropdown > .nav-tabs > li').click(function () {
$(this).parent().toggleClass('nav-tabs-open');
});
});
</script>
<!-- code folding -->
<script>
$(document).ready(function () {
window.initializeSourceEmbed("commits-travel.Rmd");
});
</script>
<script>
$(document).ready(function () {
// temporarily add toc-ignore selector to headers for the consistency with Pandoc
$('.unlisted.unnumbered').addClass('toc-ignore')
// move toc-ignore selectors from section div to header
$('div.section.toc-ignore')
.removeClass('toc-ignore')
.children('h1,h2,h3,h4,h5').addClass('toc-ignore');
// establish options
var options = {
selectors: "h1,h2,h3",
theme: "bootstrap3",
context: '.toc-content',
hashGenerator: function (text) {
return text.replace(/[.\\/?&!#<>]/g, '').replace(/\s/g, '_');
},
ignoreSelector: ".toc-ignore",
scrollTo: 0
};
options.showAndHide = true;
options.smoothScroll = true;
// tocify
var toc = $("#TOC").tocify(options).data("toc-tocify");
});
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>