Skip to content

Latest commit

 

History

History
294 lines (178 loc) · 5.42 KB

slides.md

File metadata and controls

294 lines (178 loc) · 5.42 KB
subtitle output
Go to next slide
ioslides_presentation
knitr::opts_chunk$set(echo = FALSE)

GitHub flow + RStudio

Mauro Lepore

--

Repo: http://bit.ly/github-demo
Slides: http://bit.ly/github-berlin

--

Set up issues?

License

Creative Commons Attribution-ShareAlike 4.0 International
http://creativecommons.org/licenses/by-sa/4.0

--

Many images and ideas come from
https://jennybc.github.io/wtf-2019-rsc/

Why Git/GitHub?

Excuse me, do you have a moment to talk about version control?

Outline | Part 1

  1. Why GitHub flow -- not Git flow?

  2. GitHub flow from GitHub:

  3. Recap: Understanding the GitHub flow.

  4. Questions

Outline | Part 2

  1. GitHub flow via RStudio:

  2. Questions / Discussion, e.g.:

Appendix

What is a commit?

What is a commit?

What is a commit?

What is a commit?

What is a commit?

What is a commit?

What is a commit?

What is a commit?

What is a commit?

What is a commit?

What is a commit?

Installation

https://happygitwithr.com/workshops.html#pre-workshop-set-up

Git configuration

In R

usethis::edit_git_config()

In the terminal

git config --global -l

git config --global user.email "[email protected]"
git config --global user.name "maurolepore"

core.editor=notepad
push.default=current
pull.ff=only

Cache credentials

RStudio & terminal

git checkout -b 57_add-full-url

git push -u origin 57_add-full-url
# Or
git config --global push.default "current"
git push

git add .
git commit -m "Add full URLs (closes #57)"

git commit --amend -m "Agregar URLs completos (closes #57)"

git reset --hard

git checkout master

# Agregar el remoto "upstream"
git remote add upstream [email protected]:maurolepore/fgeo.plot.git

Terminal

git fetch upstream
git checkout master
git rebase upstream/master

Alternative

# reset ~1 commit
# reset ~2 commits
# reset ~n commits
git reset HEAD~1

# ~1 revert ~1 commit
# --no-edit for auto message
git revert HEAD~1 --no-edit

# Revert commit with SHA a867f483
git revert a867f483 --no-edit

# Cherry pick commit 63da5bb3
git cherry-pick 63da5bb3

# Local
git branch -d a-branch
# Local, force
git branch -D a-branch

# From remote origin
git push -d origin a-branch

# From remote upstream
git push -d upstream a-branch

# ~3 manipulate ~3 commits
git rebase -i HEAD~3

# Commands:
# p, pick = use commit
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# ...
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
git rebase --abort
git commit --amend -m "New commit message"
git rebase --continue

https://about.gitlab.com/2018/06/07/keeping-git-commit-history-clean/