-
Notifications
You must be signed in to change notification settings - Fork 1
/
colabs_github.html
759 lines (664 loc) · 31.2 KB
/
colabs_github.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
<!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>Trabalho em colaboração</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">Trabalho em colaboração</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>Outra potencialidade do git e GitHub é a possibilidade de utilizar
estas ferramentas para trabalhos colaborativos eficientes. Quem nunca
perdeu aquela versão que o colaborador/colaboradora enviou por email? ou
aquele arquivo importante enviado por Whats? Ou mesmo numa pasta
compartilhada com ferramentas específicas de armazenamento em nuvem,
quem nunca se deparou com “você tem OneDrive? e Google Drive?”.</p>
<p>Pois essa seção visa mostrar o básico sobre trabalho em colaboração
utilizando o GitHub. Nada melhor que começar com essas palavras da Jenny
Brian</p>
<p><img src="figs/colab-horst-brian.png" width="60%" style="display: block; margin: auto;" /></p>
</div>
<div id="branches" class="section level1">
<h1>Branches</h1>
<p>Os branches são versões alternativas do trabalho que fazemos no
<code>main</code> ou <code>master</code>. Em outras palavras, são
desvios de rotas que podem ser usados para testar, por exemplo, análises
diferentes, ou um local seguro para os colaboradores fazerem
modificações que acha pertinente, sem comprometer o trabalho que está
sendo realizado no <code>main</code>, que, vale lembrar, também é um
branch.</p>
<div id="criando-um-branch" class="section level2">
<h2>Criando um branch</h2>
<p>Podemos criar branches de duas formas distintas:</p>
<p>1 - usando o próprio GitHub no browser - nesta opção devemos ir até a
página do repositório e criar um novo branch como demonstrado na imagem
a seguir. Basta clicar em master, digitar um novo nome para o branch e
pedir para criar um novo branch com o nome digitado.</p>
<p><img src="figs/colab-branch.png" width="60%" style="display: block; margin: auto;" /></p>
<p><strong>Obs</strong> Quando esta opção for utilizada, ao retornar
para o RStudio não se esqueça de fazer um <code>pull</code> no seu
diretório. Lembre-se, as modificações foram feitas apenas no repositório
remoto, então precisamos “puxar” essas modificações para o nosso
diretório local. Após o pull uma mensagem irá aparecer no seu console
(se estiver mexendo na linha de comando), ou num pop-up (se estiver
mexendo no RStudio)</p>
<p><img src="figs/new-branch-pull.png" width="60%" style="display: block; margin: auto;" /></p>
<p>2 - Podemos usar a linha de comando no terminal e criar o branch</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 branch nome<span class="sc">-</span>para<span class="sc">-</span>novo<span class="sc">-</span>branch</span></code></pre></div>
<p>Na linha de comando usamos a função <code>branch</code> do git e
nomeamos o novo branch com o nome desejado.</p>
</div>
<div id="navegando-entre-branches" class="section level2">
<h2>Navegando entre branches</h2>
<p>Para navegar entre branches podemos utilizar duas abordagens</p>
<p>1 - usando o RStudio, basta clicar na seta onde está escrito o nome
do branch (master geralmente), e você vai ver as opções de branches
existentes</p>
<p><img src="figs/colab-branch-change.png" width="60%" style="display: block; margin: auto;" /></p>
<p>2 - usando a linha de comando, como demosntrado abaixo</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 checkout nome<span class="sc">-</span>do<span class="sc">-</span>branch</span></code></pre></div>
<p>Usamos a função <code>checkout</code> do git para acessar um branch.
Você vai notar que ao modificar o branch, os arquivos no seu diretório
vão mudar (caso os arquivos de um branch e de outro sejam
diferentes).</p>
</div>
<div id="fusionando-os-branches-merge" class="section level2">
<h2>Fusionando os branches (merge)</h2>
<p>Vamos supor que estamos trabalhando em conjunto com outros
colaboradores. O seu colaborador teve uma ideia que pode melhor o
trabalho que está fazendo, por exemplo, adicionando um novo modelo para
análise de dados. O colaborador/colaboradora resolve implementar esta
modificação em um novo branch. Essa implementação funciona melhor que a
anterior e então resolvemos adotar ela como a nova estratégia de análise
de dados. Mas ela vive em um branch diferente do <code>main</code>,
sendo que o ideal é que ela seja incorporada no main. Ou seja, queremos
fusionar o branch do colaborador/colaboradora, ao passo que mantemos as
modificações no branch main. Fazemos isso com um a função
<code>merge</code> do git.</p>
<p>De novo, existem duas formas de se fazer isso</p>
<p>1 - utilizando o GitHub online. Navegue até a página do seu
repositório. Acesse o branch que quer fazer o merge no branch main. Note
que, em caso de diferenças entre os branches, uma mensagem aparecerá
perguntando se você quer comparar os branches e abrir um pull-request,
como na imagem abaixo</p>
<p><img src="figs/merge-pull-request.png" width="60%" style="display: block; margin: auto;" /></p>
<p>Neste momento, o github está te dizendo: “Existe uma diferença entre
o branch main e o branch novo criado, você quer revisar essas
modificações e abrir um pull-request para o proprietário deste
repositório?, e depois quer fusionar esses branches?” Com isso você pode
mergir os branches. <strong>OBS</strong> lembre-se de que quando voltar
para o RStudio você precisa dar um <code>pull</code></p>
<p>2 - podemos utilizar a linha de comando. Nela vá até o branch que
deseja incorporar as mudanças do outro branch, e use a função
<code>merge</code>do git</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 checkout main</span>
<span id="cb3-2"><a href="#cb3-2" tabindex="-1"></a>git merge nome<span class="sc">-</span>do<span class="sc">-</span>branch</span></code></pre></div>
<p>Pronto, agora o branch <code>main</code> incorporou as modificações
do branch <code>nome-do-branch</code></p>
</div>
</div>
<div id="prática" class="section level1">
<h1>Prática</h1>
<p>Como prática sugerimos que os estudantes se juntem em duplas e
simulem um trabalho colaborativo. O roteiro seria mais ou menos
esse:</p>
<p>1 - Uma pessoa convida um colaborador para o seu repositório no
Github. A pessoa convidada deve aceitar o convite.</p>
<p>2 - O colaborador deve criar um novo branch seguindo uma das formas
ilustradas acima (ou outra que ache mais conveniente)</p>
<p>3 - Faça algumas modificações no branch novo criado e faça um
pull-request</p>
<p>4 - A pessoa responsável pelo repositório deve revisar o pull-request
e incorporar as sugestões no <code>branch main</code></p>
</div>
<div id="referências" class="section level1">
<h1>Referências</h1>
<p>Como sempre, o livro da Jenny Brian - Happy Git and GitHub for the
UseR</p>
</div>
<div id="rmd-source-code">LS0tCn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V0cmEgcXVlIGFjaGUgbWFpcyBjb252ZW5pZW50ZSkKCjMgLSBGYcOnYSBhbGd1bWFzIG1vZGlmaWNhw6fDtWVzIG5vIGJyYW5jaCBub3ZvIGNyaWFkbyBlIGZhw6dhIHVtIHB1bGwtcmVxdWVzdAoKNCAtIEEgcGVzc29hIHJlc3BvbnPDoXZlbCBwZWxvIHJlcG9zaXTDs3JpbyBkZXZlIHJldmlzYXIgbyBwdWxsLXJlcXVlc3QgZSBpbmNvcnBvcmFyIGFzIHN1Z2VzdMO1ZXMgbm8gYGJyYW5jaCBtYWluYAoKCiMgUmVmZXLDqm5jaWFzCgpDb21vIHNlbXByZSwgbyBsaXZybyBkYSBKZW5ueSBCcmlhbiAtIEhhcHB5IEdpdCBhbmQgR2l0SHViIGZvciB0aGUgVXNlUg==</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("colabs_github.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>