diff --git a/.nojekyll b/.nojekyll index 7fa5e5b..7341dd3 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -cc8e168b \ No newline at end of file +5057411d \ No newline at end of file diff --git a/assets/workflows/github_basic.png b/assets/workflows/github_basic.png new file mode 100644 index 0000000..9ab9bd3 Binary files /dev/null and b/assets/workflows/github_basic.png differ diff --git a/basics.html b/basics.html index e280e35..cd81130 100644 --- a/basics.html +++ b/basics.html @@ -247,14 +247,16 @@

1  1.1 Getting started

1.1.1 Installing Git

+

Here is a general guide for installing git for the different operating software.

1.1.2 Setting up

-

GitHub account

+

If you don’t already have one create a GitHub account.

@@ -268,15 +270,23 @@

If you are a university student you qualify for a free pro account

-

Authorisations/configuring to github

1.1.3 Talking to git

- +

Now that you have installed git you need to link it to your GitHub account and make sure that the two are able to ‘talk’ to each other. Again there are many ways to set this up. We will discuss some of these approaches below.

+
+

1.1.3.1 Linking with RStudio

+
    +
  1. Tell RStudio where to find the git programme: Under the Tools menu, open Global Options and go to the Git/SVN section. Then enable the version control interface and make sure RStudio knows where to find git. For MacOS, enter the path (which you can find by typing which git into your terminal), for Windows, find the git program in your Program Files.
  2. +
  3. Configure Git: The easiest way to do this is in R through the {usethis} package (so install that if you don’t have it - install.packages(“usethis”)). and you can just run usethis::use_git_config(user.name=“Jane Doe”, user.email=“jane@example.org”) in your R console. Replace with your name and the email that is linked to your GitHub account
  4. +
  5. Link your GitHub account: Now you need to link your GitHub account/credentials. The path of least resistance is going the HTTPS, personal access token (PAT) route. {usethis} package, which outlines how to get a PAT and link that to your git credentials.
  6. +
+
+
+

1.1.3.2 Linking with VSCode

+
+
+

1.1.3.3 Linking with Terminal

@@ -287,12 +297,19 @@

+

1.2 Understanding the version control workflow

1.2.1 Key terms

repo - short for repository repository - the directory or folder that is under version control local - the repository on your computer remote - the repository on GitHub commit - take a snapshot of one or more files in the repository push - send commits from the local repo to the remote repo pull - retrieve commits from the remote repo to the local repo .gitignore a file that tells git which files or types of files you don’t want to commit

Let’s start by briefly explaining the basic workflow. On GitHub you can make repositories, which is a kind of project. Your online repository, or short repo, is called remote. To use your repository, you need to clone it locally onto your computer and it is then called local. You can write and edit R code locally on your computer. The new code is then committed and pushed back to the remote. If you follow this workflow consistently, GitHub will keep track of all the changes you make.

+
+
+

+
This is the basic github workflow. First we need to retrieve the remote version of repository. We now have an exact copy of the online repository locally. We are then free to work on and develop the files that are in the repository. Once we have made our changes we need to send these back to the remote repository.
+
+
diff --git a/index.html b/index.html index 442321a..3b0ea4b 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ - + Using Github for Scientific Collaboration