generated from datatrail-jhu/DataTrail_Template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
06_sharing_results_04_creating_repos.Rmd
68 lines (32 loc) · 5.56 KB
/
06_sharing_results_04_creating_repos.Rmd
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
```{r, include = FALSE}
ottrpal::set_knitr_image_path()
```
# Creating a Repository
Now that you have learned about version control and the GitHub website, we will do some actual work with the GitHub website to create a new repository and set up your user profile.
### What is a Repository?
First let's review what a repository is. A repository houses the entirety of a project. Imagine a filing cabinet. A repository for this project would be the filing cabinet itself. Inside the cabinet are various folders and files that make up the project. As you begin working on various projects, each one will likely have its own repository, and any work that you do will be housed in that repository. In the first part of this lesson, we will discuss how to create a repository using the GitHub website.
### How Do I Create a GitHub Repository?
#### Step 1
First, navigate to the GitHub website: [github.com](https://github.com/). Click the green button on the right hand side of the page that allows you create a new repository.
![Creating a new repository](https://docs.google.com/presentation/d/1Dxf8VZi4RAf4BA8Xb__gbnTxFLIJKM-mxSy_BMA48DU/export/png?id=1Dxf8VZi4RAf4BA8Xb__gbnTxFLIJKM-mxSy_BMA48DU&pageid=g2bfdb07292_0_151)
#### Step 2
You will be taken to a new page where you can set up information about this new repository. Most importantly, create a descriptive name for the repository that relates to your project. This will help you remember what repository holds your files for this project if you have many repositories or come back to the project at a later time.
Including a description for your repository is optional.
You have a choice to make your repository public or private. Public repositories are viewable by the public. Anyone can see what code you have used for this project. You can still control who can contribute to this particular repository, but the repository is open to being forked by other people who may want to build off of your work in their own repositories. Private repositories are not viewable by the public, and you can still control who can contribute to this particular repository. It is generally a nice choice to make a repository public to share your work with others, but if you are working with sensitive information, it would be best to make the repository private. Keep in mind that you can have private repositories on GitHub only if you are a paid subscriber.
You can leave the other options at their default settings.
When you are satisfied with these settings, click the "Create repository" button at the bottom.
![Setting up a new repository](https://docs.google.com/presentation/d/1Dxf8VZi4RAf4BA8Xb__gbnTxFLIJKM-mxSy_BMA48DU/export/png?id=1Dxf8VZi4RAf4BA8Xb__gbnTxFLIJKM-mxSy_BMA48DU&pageid=g38bb68a530_0_8)
And you're done! You will be taken to a page that looks as below. This page contains information about the commands that will be useful when adding files to your repository later on. We will cover the use of these commands from Posit Cloud in subsequent lessons.
![Landing page](https://docs.google.com/presentation/d/1Dxf8VZi4RAf4BA8Xb__gbnTxFLIJKM-mxSy_BMA48DU/export/png?id=1Dxf8VZi4RAf4BA8Xb__gbnTxFLIJKM-mxSy_BMA48DU&pageid=g38bb68a530_0_19)
### Adding a README File
If you click on the link labeled README indicated in the picture below, you can add a README file to your currently empty repository. The README file is the first thing someone sees when they navigate to the page for your repository. It is useful for providing an overview for what is contained within it.
![Creating a README](https://docs.google.com/presentation/d/1Dxf8VZi4RAf4BA8Xb__gbnTxFLIJKM-mxSy_BMA48DU/export/png?id=1Dxf8VZi4RAf4BA8Xb__gbnTxFLIJKM-mxSy_BMA48DU&pageid=g38bb68a530_0_24)
When you click on that link, you will be taken to a page pictured below where you can edit the text of this file and preview what it will look like on the GitHub website. It has been automatically filled in with the title of our repository and the optional description we entered previously. Feel free to add additional description. The README file is a markdown document so you will have to use the markdown syntax you learned in the last course to edit this document.
![Editing a README](https://docs.google.com/presentation/d/1Dxf8VZi4RAf4BA8Xb__gbnTxFLIJKM-mxSy_BMA48DU/export/png?id=1Dxf8VZi4RAf4BA8Xb__gbnTxFLIJKM-mxSy_BMA48DU&pageid=g38bb68a530_0_32)
When you are finished editing your README file, scroll to the bottom of the page to commit your changes. Here, GitHub automatically suggests that "Create README" is your commit messages. As this is informative of what you have done, you do not need to add additional text; however, you're welcome to make this commit message even more informative if you'd like.
![Committing changes](https://docs.google.com/presentation/d/1Dxf8VZi4RAf4BA8Xb__gbnTxFLIJKM-mxSy_BMA48DU/export/png?id=1Dxf8VZi4RAf4BA8Xb__gbnTxFLIJKM-mxSy_BMA48DU&pageid=g38bb68a530_0_38)
Click the "Commit new file button" to add this README to your repository. You will be taken to the homepage for your repository, as pictured below.
![Repository homepage](https://docs.google.com/presentation/d/1Dxf8VZi4RAf4BA8Xb__gbnTxFLIJKM-mxSy_BMA48DU/export/png?id=1Dxf8VZi4RAf4BA8Xb__gbnTxFLIJKM-mxSy_BMA48DU&pageid=g38bb68a530_0_43)
Congratulations! You have created and set up your first repository!
### The GitHub Guide
GitHub also recognizes that this can be an overwhelming process for new users, and as such have developed a mini tutorial to get you started with GitHub. You can go through [this guide](https://guides.github.com/activities/hello-world/) to get further process setting up repositories on GitHub!