Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change all instances of "git" to "Git" #105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions RAP/rap-statistics.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ For further resources on learning R so that you're able to apply it to your ever

Using the recommended tools on our [learning](../learning-development/learning-development.html) page ([SQL](../learning-development/sql.html), [R](../learning-development/r.html) and [Git](../learning-development/git.html)), or other suitable alternatives that allow you to meet the [core principles](#core-principles). Ideally any tools used would be open source, Python is a good example of a tool that would also be well suited, though is less widely used in DfE and has a steeper learning curve than R.

Open-source refers to something people can modify and share because its design is publicly accessible. For more information, take a look at this [explanation of open-source](https://opensource.com/resources/what-open-source){target="_blank" rel="noopener noreferrer"}, as well as this guide to [working in an open-source way](https://opensource.com/open-source-way){target="_blank" rel="noopener noreferrer"}. In practical terms, this means moving away from the likes of SPSS, SASS and Excel VBA, and utilising the likes of R or Python, version controlled with git, and hosted in a publicly accessible repository.
Open-source refers to something people can modify and share because its design is publicly accessible. For more information, take a look at this [explanation of open-source](https://opensource.com/resources/what-open-source){target="_blank" rel="noopener noreferrer"}, as well as this guide to [working in an open-source way](https://opensource.com/open-source-way){target="_blank" rel="noopener noreferrer"}. In practical terms, this means moving away from the likes of SPSS, SASS and Excel VBA, and utilising the likes of R or Python, version controlled with Git, and hosted in a publicly accessible repository.

**Why do it?**

Expand Down Expand Up @@ -709,7 +709,7 @@ All of the benefits you get from peer reviewing within your own team, multiple t

**How to get started**

While peer reviewing code within the team is often practical, having external analysts peer review your code can bring a fresh perspective. If you're interested in this, please contact us, and we can help you to arrange someone external to your team to review your processes. For this to work smoothly, we recommend that your code is easily accessible for other analysts, such as hosted in an Azure DevOps repo and mirrored to github.
While peer reviewing code within the team is often practical, having external analysts peer review your code can bring a fresh perspective. If you're interested in this, please contact us, and we can help you to arrange someone external to your team to review your processes. For this to work smoothly, we recommend that your code is easily accessible for other analysts, such as hosted in an Azure DevOps repo and mirrored to Github.

---

Expand Down Expand Up @@ -1020,12 +1020,12 @@ The [Self-assessment tool](https://github.com/dfe-analytical-services/publicatio

---

## Version control with git
## Version control with Git


If you do not already have git downloaded, you can [download the latest version from their website](https://git-scm.com/downloads).
If you do not already have Git downloaded, you can [download the latest version from their website](https://git-scm.com/downloads).

For now, take a look at at the [resources for learning git](../learning-development/git.html) in the learning resources section.
For now, take a look at at the [resources for learning Git](../learning-development/git.html) in the learning resources section.

---

Expand All @@ -1037,7 +1037,7 @@ For now, take a look at at the [resources for learning git](../learning-developm

**What does this mean?**

This means having the final copies of code and documentation saved in a git-controlled Azure DevOps repo in the official-statistics-production area. Access to DevOps is restricted only to people in DfE with specific account permissions. This is different to GitHub, which makes code publicly available.
This means having the final copies of code and documentation saved in a Git-controlled Azure DevOps repo in the official-statistics-production area. Access to DevOps is restricted only to people in DfE with specific account permissions. This is different to GitHub, which makes code publicly available.

**Why do it?**

Expand Down Expand Up @@ -1095,7 +1095,7 @@ You should consider the following principles making an Official Statistics produ

When naming your publication's repository you should use the publication name fully written out, in lower case, and with dashes for spaces – ‘graduate-labour-market-statistics’.

A single repository should be used for all releases of your publication, there's no need to have multiple as all the history is saved within previous commits. You can make use of [tagging releases in git](../learning-development/git.html#Tagging_release_versions) to help differentiate between each cycle.
A single repository should be used for all releases of your publication, there's no need to have multiple as all the history is saved within previous commits. You can make use of [tagging releases in Git](../learning-development/git.html#Tagging_release_versions) to help differentiate between each cycle.

---

Expand All @@ -1108,22 +1108,22 @@ Here are some general best practice tips:
- Using .gitignore to ignore files and folders to prevent committing anything sensitive
- Never committing outputs unless they’ve been checked over, even aggregates. We suggest only outputting to an output folder which is in the .gitignore file, to ensure this doesn’t happen by mistake
- Keeping datasets and secrets (e.g. API keys) outside the repository as much as possible, make use of secure variables
- Checking git histories: if someone is planning on open-sourcing code that has previously been in a private repository or only version-controlled locally, you want to be careful not to have anything sensitive in the commit history. You can do this by following the above rules. When in doubt, you can remove the git history and start the public repo without it
- Checking Git histories: if someone is planning on open-sourcing code that has previously been in a private repository or only version-controlled locally, you want to be careful not to have anything sensitive in the commit history. You can do this by following the above rules. When in doubt, you can remove the Git history and start the public repo without it
- You can [remove a file from the entire commit history](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository) if you did commit anything sensitive, although you still need to follow the usual procedures if this was a data breach

You can find out more in the duck book's [guidance on using git](https://best-practice-and-impact.github.io/qa-of-code-guidance/version_control.html#avoid-commiting-sensitive-information-to-git-repositories).

---

### Collaboratively develop code using git
### Collaboratively develop code using Git

---

`r knitr::include_graphics("../images/best.svg")`

**What does this mean?**

- Has code development taken place in git, collaboratively across the team?
- Has code development taken place in Git, collaboratively across the team?

- Are you making use of pull requests for team members to review and comment on code updates?

Expand All @@ -1132,19 +1132,19 @@ You can find out more in the duck book's [guidance on using git](https://best-pr

**Why do it?**

Using git allows multiple people to simultaneously develop the same code using branches, all with a crystal clear audit trail showing what changes were made when using commits. It makes it easy for team members to review changes via pull requests.
Using Git allows multiple people to simultaneously develop the same code using branches, all with a crystal clear audit trail showing what changes were made when using commits. It makes it easy for team members to review changes via pull requests.

**How to get started**

To get started you should:

---

#### Get your code into a git controlled folder
#### Get your code into a Git controlled folder

---

Get code into a git controlled folder in whatever version it is currently in. Use the following steps to do so:
Get code into a Git controlled folder in whatever version it is currently in. Use the following steps to do so:

1. Open the folder where your project is saved, right click anywhere in that window, and click "Git Bash Here".

Expand All @@ -1166,11 +1166,11 @@ git remote add origin YOUR_URL_HERE
git push -f origin --all
```

* You may be prompted for either your windows or git credentials at this stage.
* You may be prompted for either your windows or Git credentials at this stage.

+ If prompted for your **windows** credentials, enter the username and password combination you use to log into your DfE device.

+ If prompted for your **git** credentials, visit your online repository, click on the blue "clone" box, and click "generate git credentials". This will generate a username and password for you to enter.
+ If prompted for your **Git** credentials, visit your online repository, click on the blue "clone" box, and click "generate git credentials". This will generate a username and password for you to enter.

4. Visit your repository online, and check that all the files have uploaded. Other members of your team will now be able to work from your code.

Expand All @@ -1187,16 +1187,16 @@ git push -f origin --all

To clone code, they will need to do the following:

1. Run through steps 1 - 2a of [getting a file into a git controlled folder](#get-your-code-into-a-git-controlled-folder)
1. Run through steps 1 - 2a of [getting a file into a Git controlled folder](#get-your-code-into-a-git-controlled-folder)

3. After running those lines, type in the following with your repository URL in the "YOUR_URL_HERE" space. This will clone the online repository to your local area.

``` {r git_team_steps, eval=FALSE}
git clone YOUR_URL_HERE
```

- Make use of git and version control in your team projects regularly. Like learning anything new, putting it into practice regularly is the best way to become confident in using it.
- Make use of Git and version control in your team projects regularly. Like learning anything new, putting it into practice regularly is the best way to become confident in using it.

Please refer to the other links on the [Git learning resources](../learning-development/git.html#other-resources) page to learn more about how to use git in practice.
Please refer to the other links on the [Git learning resources](../learning-development/git.html#other-resources) page to learn more about how to use Git in practice.

---