@@ -76,14 +76,47 @@ Be careful about storing valuable IP of yours in places that can take it away fr
76
76
:::
77
77
78
78
79
+ # agenda
80
+
79
81
## agenda
80
82
81
83
- terminology
84
+ - terminalogy
82
85
- workflows: I
83
86
- tools
84
87
- workflows: II
85
88
- unhappy paths
86
89
90
+ ## resources
91
+
92
+ ::: columns
93
+
94
+ ::: {.column}
95
+
96
+ ### What They Forgot
97
+
98
+ [ ![ ] ( ./img/wtf-logo-square-transparent.png )] ( https://rstats.wtf )
99
+ :::
100
+
101
+ ::: {.column}
102
+
103
+ ### Happy Git with R
104
+
105
+ [ ![ ] ( ./img/happy-git.png )] ( https://happygitwithr.com )
106
+ :::
107
+
108
+ :::
109
+
110
+ ## goals
111
+
112
+ ![ ] ( ./img/inception.webp )
113
+
114
+ ::: notes
115
+ our objective is to go deeper
116
+ this workshop will emphasize terminal workflows and preview how other tools layer interactions on top
117
+ choose a workflow that works for you, and pick up sharper tools when needed
118
+ :::
119
+
87
120
# terminology
88
121
89
122
## git
@@ -173,6 +206,45 @@ the difference between _any_ two project snapshots
173
206
draw on the slides!
174
207
:::
175
208
209
+ ## ` HEAD `
210
+
211
+ ``` {mermaid}
212
+ gitGraph
213
+ commit id: "initial commit"
214
+ commit id: "snapshot one"
215
+ commit id: "HEAD"
216
+ ```
217
+
218
+ # terminalogy
219
+
220
+ ## words have meaning
221
+
222
+ terminal
223
+ shell
224
+ command-line interface (CLI)[ ^ so ]
225
+
226
+ [ ^ so ] : https://askubuntu.com/a/506628
227
+
228
+
229
+ ## structure
230
+
231
+ ` command subcommand --long-argument -s `
232
+
233
+ ## navigating
234
+
235
+ ` pwd `
236
+ ` cd `
237
+ ` ls -lha `
238
+
239
+ ## creating
240
+
241
+ ` mkdir `
242
+ ` rmdir `
243
+ ` touch `
244
+ ` cp `
245
+ ` mv `
246
+ ` rm `
247
+
176
248
# workflows: I
177
249
178
250
## systems check
@@ -214,10 +286,6 @@ click to "show hidden files"
214
286
215
287
:::
216
288
217
- ## some terminal basics
218
-
219
- whereami, whoami
220
-
221
289
## new project
222
290
223
291
- create project (from rstudio, or terminal)
@@ -420,7 +488,29 @@ Changes not staged for commit:
420
488
421
489
[ existing project, github first] ( https://happygitwithr.com/existing-github-first.html )
422
490
423
- ## push
491
+ ## publish to github: setup
492
+
493
+ ```
494
+ git remote add origin https://github.com/edavidaja/intro-git.git
495
+ git branch -M main
496
+ ```
497
+
498
+ ## ` git push `
499
+
500
+ ``` shell
501
+ intro-git on main
502
+ ❯ git push -u origin main
503
+ Enumerating objects: 5, done.
504
+ Counting objects: 100% (5/5), done.
505
+ Delta compression using up to 12 threads
506
+ Compressing objects: 100% (3/3), done.
507
+ Writing objects: 100% (5/5), 418 bytes | 418.00 KiB/s, done.
508
+ Total 5 (delta 0), reused 0 (delta 0), pack-reused 0
509
+ To https://github.com/edavidaja/intro-git.git
510
+ * [new branch] main -> main
511
+ branch ' main' set up to track ' origin/main' .
512
+ ```
513
+
424
514
425
515
# tools
426
516
@@ -485,6 +575,47 @@ gitGraph
485
575
486
576
## push rejection
487
577
578
+ ``` shell
579
+ intro-git on main [⇡] via R v4.2.3
580
+ ❯ git push
581
+ To https://github.com/edavidaja/intro-git.git
582
+ ! [rejected] main -> main (fetch first)
583
+ error: failed to push some refs to ' https://github.com/edavidaja/intro-git.git'
584
+ hint: Updates were rejected because the remote contains work that you do
585
+ hint: not have locally. This is usually caused by another repository pushing
586
+ hint: to the same ref. You may want to first integrate the remote changes
587
+ hint: (e.g., ' git pull ...' ) before pushing again.
588
+ hint: See the ' Note about fast-forwards' in ' git push --help' for details.
589
+ ```
590
+
591
+ ## merge strategy
592
+
593
+ ``` shell
594
+ intro-git on main [⇡] via R v4.2.3
595
+ ❯ git pull
596
+ remote: Enumerating objects: 5, done.
597
+ remote: Counting objects: 100% (5/5), done.
598
+ remote: Compressing objects: 100% (2/2), done.
599
+ remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
600
+ Unpacking objects: 100% (3/3), 636 bytes | 212.00 KiB/s, done.
601
+ From https://github.com/edavidaja/intro-git
602
+ 2bdda53..424444e main -> origin/main
603
+ hint: You have divergent branches and need to specify how to reconcile them.
604
+ hint: You can do so by running one of the following commands sometime before
605
+ hint: your next pull:
606
+ hint:
607
+ hint: git config pull.rebase false # merge
608
+ hint: git config pull.rebase true # rebase
609
+ hint: git config pull.ff only # fast-forward only
610
+ hint:
611
+ hint: You can replace " git config" with " git config --global" to set a default
612
+ hint: preference for all repositories. You can also pass --rebase, --no-rebase,
613
+ hint: or --ff-only on the command line to override the configured default per
614
+ hint: invocation.
615
+ fatal: Need to specify how to reconcile divergent branches.
616
+ ```
617
+
618
+
488
619
## merge conflicts
489
620
490
621
``` {mermaid}
@@ -498,3 +629,28 @@ gitGraph
498
629
checkout main
499
630
commit
500
631
```
632
+ ## merge conflict
633
+
634
+ ``` shell
635
+ intro-git on main [⇕] via R v4.2.3
636
+ ❯ git pull --rebase
637
+ Auto-merging main.R
638
+ CONFLICT (content): Merge conflict in main.R
639
+ error: could not apply 160ea3e... added tidyverse
640
+ hint: Resolve all conflicts manually, mark them as resolved with
641
+ hint: " git add/rm <conflicted_files>" , then run " git rebase --continue" .
642
+ hint: You can instead skip this commit: run " git rebase --skip" .
643
+ hint: To abort and get back to the state before " git rebase" , run " git rebase --abort" .
644
+ Could not apply 160ea3e... added tidyverse
645
+ ```
646
+ ##
647
+
648
+ ``` r
649
+ <<<<<<< HEAD
650
+ library(shiny )
651
+ ||||||| parent of 160ea3e (added tidyverse )
652
+ =======
653
+ library(tidyverse )
654
+ >>>>>>> 160ea3e (added tidyverse )
655
+
656
+ ```
0 commit comments