Skip to content

Commit 350f6fa

Browse files
committed
updating with remotes -- part iii
1 parent fed0abe commit 350f6fa

File tree

2 files changed

+150
-8
lines changed

2 files changed

+150
-8
lines changed

handson_pr.Rmd

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
title: "Git: Remotes, Collaborate, Pull Requests "
3+
output:
4+
html_document:
5+
self_contained: false
6+
---
7+
8+
This document follows set-up from the [first hands-on](handson.html)
9+
10+
This section introduces a variety of topics: fork, pull requests, collaborators, wikis on GitHub, Issues on GitHub, and git remotes.
11+
12+
## Roll back
13+
14+
## File
15+
16+
Sometimes the easiest thing to do is grab the file (or subtext from a file) in a previous commit that is already displayed on GitHub. To do so.
17+
18+
1. Find your repository on GitHub
19+
1. Click the "commits" tab
20+
1. Click the SHA link for the commit which has the most recent working version
21+
1. Click the filename representing the working file you want
22+
1. Click View; Raw
23+
1. Copy what you want and over-write your local repository with the previously working version
24+
25+
## Repository
26+
27+
<figure>![](https://imgs.xkcd.com/comics/git.png)<figcaption>KXCD. Git: https://xkcd.com/1597/</figcaption></figure><br>
28+
29+
30+
## Collaborating
31+
32+
Repositories can have collaborators which have full access to change code. Alternatively, anyone can fork a repository and make their own changes their forked copy of your public repository. The author of the changes (in the forked repository) can then initiate a "Pull Request" which enables the root repository owner to consider whether those changes will be integrated into the main repository.
33+
34+
### Fork
35+
36+
When you fork a repository you make a copy of that repository on GitHub. The difference between fork and clone is that clone does not make a GitHub copy and will not be eligible to submit modifications as a pull request. If you simply want to run code from another repository, clone the repository locally.
37+
38+
If you intend to submit modifications to some other repository by issuing a Pull Request, fork the repository first. Then clone the forked repository.
39+
40+
https://github.com/data-and-visualization/pr_hello-world
41+
42+
1. [Source] Fork this repository
43+
1. [Partner] Clone your forked copy of the repository
44+
1. [Partner] Make some changse to your cloned [forked] repository. (e.g. add a file, edit the readme, etc.)
45+
1. [Partner] Using the git commands you've already learned: add, commit, and push the changes
46+
47+
48+
### Pull Requests
49+
50+
1. [Partner] From GitHub, find the **Pull Request** tab `>` New Pull Request
51+
52+
The act of initiating a new Pull Request will spawn a message to the original owners of the source repository.
53+
54+
1. [Source] Go to your repository
55+
1. Merge Pull request
56+
57+
### Collaborators
58+
59+
To enable a collaborator (GitHub) or member (GitLab), simply edit the settings for your repository on GitHub. You collaborator can then clone the repository and use git functions just as you do.
60+
61+
For Example, in GitHub.
62+
63+
1. Login to the repository
64+
1. Go to the Settings
65+
1. Choose Collaborators
66+
67+
## Wikis on GitHub
68+
69+
The GitHub Wiki is unique to your repository. Use it to lay out a roadmap of your project.
70+
71+
## Issues on GitHub
72+
73+
The issues section is a good place to track bugs with your repository. You might even use this as a public todo list.
74+
75+
## Remotes
76+
77+
In the **terminal**, try these `git` commands. What do they mean...
78+
79+
``` sh
80+
git branch
81+
git remote
82+
git remote -v
83+
```
84+
85+
86+
### Add a Remote
87+
88+
You can push your local repository to more than one remote social coding location...
89+
90+
``` sh
91+
git remote add <<branch name>> <<repo location>>
92+
93+
# e.g. `git remote add <<branch name>> <<GitHub Repo Address>>
94+
# e.g. a GitHub Remote Address might look like this: https://github.com/data-and-visualization/mozadrella-test.git
95+
96+
git remote -v
97+
git push -u mirror-dvs master # u stands for *upstream*
98+
git push mirror-dvs master
99+
```
100+
101+
102+
103+
<!-- Notes for Next Section -->
104+
<!-- Should cover collaboration
105+
- Simplicity of the Roll-back on Social Coding sites (look at a previous version, copy/paste)
106+
- XKCD: sync-up ; If errors: save work elseswhere, delete and download a fresh copy.
107+
- pull requests
108+
- revert
109+
- reset
110+
- remotes
111+
- triggers / Webhooks
112+
- add collaborators
113+
- Organizational Accounts
114+
- wiki
115+
- issues
116+
and collaboration -->
117+

resources.Rmd

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,44 @@ output:
66
toc: FALSE
77
---
88

9-
- Duke’s [GitLab](https://gitlab.oit.duke.edu/)
9+
## Social Coding Sites
10+
11+
- https://github.com
12+
- https://gitlab.com
13+
- https://bitbucket.org
14+
15+
- Duke’s [GitLab](https://gitlab.oit.duke.edu/) Instance
1016

1117
- [Managing SSH keys](https://gitlab.oit.duke.edu/help/ssh/README)
1218

13-
- [RMarkdown Cheatsheet](https://www.rstudio.com/wp-content/uploads/2016/03/rmarkdown-cheatsheet-2.0.pdf)
14-
- Data Carpentry [Reproducible Research Version Control](http://www.datacarpentry.org/rr-version-control/)
15-
- Interactive tools to learn Git at the Command Line
1619

17-
- Duke’s Co-Lab [Introduction to Git](https://extend.duke.edu/courses/course-v1:InnovationCoLab+998042043+2017/about)
18-
- [Got 15 minutes](https://try.github.io/levels/1/challenges/1)
19-
- [Learn Git. A free Codeacademy course ](https://www.codecademy.com/learn/learn-git) -- Free
20-
20+
### Interactive tools to learn Git at the Command Line
21+
22+
- Duke’s Co-Lab [Introduction to Git](https://extend.duke.edu/courses/course-v1:InnovationCoLab+998042043+2017/about)
23+
- [Got 15 minutes](https://try.github.io/levels/1/challenges/1)
24+
- [Learn Git. A free Codeacademy course ](https://www.codecademy.com/learn/learn-git) -- Free
25+
- [Tips & Tricks (web)](http://codingdomain.com/git/tricks/)
26+
27+
### YouTube Intro Playlist
28+
- https://www.youtube.com/playlist?list=PLfdtiltiRHWFEbt9V04NrbmksLV4Pdf3j
29+
30+
### Free Book
31+
2132
- [Happy Git and GitHub for the useR](http://happygitwithr.com/)
33+
- [10 Common Problems / Solutions](https://www.codementor.io/citizen428/git-tutorial-10-common-git-problems-and-how-to-fix-them-aajv0katd)
34+
35+
### Carpentry
36+
37+
- Data Carpentry [Reproducible Research Version Control](http://www.datacarpentry.org/rr-version-control/)
38+
39+
40+
41+
## Markdown
42+
43+
- [RMarkdown Cheatsheet](https://www.rstudio.com/wp-content/uploads/2016/03/rmarkdown-cheatsheet-2.0.pdf)
44+
45+
## Reproducibility
46+
2247
- [Writing clear code: Tools for Reproducible Research](http://kbroman.org/Tools4RR/assets/lectures/07_clearcode.pdf)
2348
- [Initial Steps Toward Reproducible Research](http://kbroman.org/steps2rr/)
2449
- Making your research reproducible with TIER + R + GitHub [Slides]. Cetinkaya-Rundel, M. (2016). Open Science Framework. Retrieved from https://osf.io/phyau

0 commit comments

Comments
 (0)