diff --git a/ch2-git-basics/basic-workflow.qmd b/ch2-git-basics/basic-workflow.qmd deleted file mode 100644 index f568878..0000000 --- a/ch2-git-basics/basic-workflow.qmd +++ /dev/null @@ -1,56 +0,0 @@ -# Covering the basics - -To help cover the essential basics of using Git for your work, we've created the [Git academy -sandbox repo on GitHub](https://github.com/dfe-analytical-services/git-academy-sandbox). The -steps covered in this walk-through are all intended to work with this sandbox repo. - - -::: {.callout-note} -## Pre-requisites -- Git -- A preferred method for running Git commands, one of: - - git bash (included in Git installation) - - GitHub Desktop - - RStudio - - Visual Studio Code -::: - -## Cloning a repository - -More often than not, you'll either have set up a remote repository already (e.g. on Azure DevOps, -GitHub or GitLab) or someone else will have. So we'll start on how to get a copy of that you can -work with to edit and run code. For this you'll need to create a local copy somewhere where you -have the software necessary to edit and run your code (e.g. R-Studio if you're using R code). -In Git parlance, creating a local copy is called "cloning" and you can do this using the -`git clone` command. - -Let's try this with the sandbox repo. Every repo has a URL which you can use to clone it. Navigate -to the [sandbox repo webpage](https://github.com/dfe-analytical-services/git-academy-sandbox) and -click the **<> Code** button near the top right. This will show a HTTPS URL that you can copy - -copy this to your clipboard. - -::: {.panel-tabset} - -### Git bash - -Now open **git bash** and run through the following steps. - -- navigate to where you want to clone the repo, e.g. - - `cd ~/repos/` (this navigates to the **repos** directory in your home directory if it exists) -- Run `git clone ...`, replacing `...` with the URL you copied from the repo home page, e.g.: - - `git clone https://github.com/dfe-analytical-services/git-academy-sandbox.git` -- Switch into the new repository, e.g.: - - `cd git-academy-sandbox` - -### GitHub Desktop - - -### R-Studio - - -### Visual Studio Code - -::: - - - diff --git a/ch2-git-basics/cloning.qmd b/ch2-git-basics/cloning.qmd deleted file mode 100644 index 0aa0731..0000000 --- a/ch2-git-basics/cloning.qmd +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: "Cloning an Existing Repository" ---- - ---- -## Introduction - -This section will guide you through the process of cloning a GitHub repository (repo). A repo contains all of your code, your files and each file's version history. Repos can have multiple collaborators and can be either private or public. You can find out more about GitHub repos on [GitHub Docs](https://docs.github.com/en/repositories/creating-and-managing-repositories/about-repositories). - -If you have a repo on Azure DevOps, GitHub or GitLab, you generally can't edit or run your work on those platforms, so if you need to work with the contents of a repo, you'll usually need to make a clone. - -There are several ways to clone an existing repo. Below, you'll find two methods. The first uses Rstudio and the second uses Git Bash. Start with step 1, which is the same for both methods, and then decide which method to follow. Once you have successfully cloned, you should see the files appear in the location you have chosen to store your repo. - -## Step 1: Get the repository clone link - -a\. Go to the [git-academy-sandbox](https://github.com/dfe-analytical-services/git-academy-sandbox) repository page on GitHub. - -b\. Click the "Code" button and copy the URL (HTTPS link). - -::: panel-tabset -## To Clone Using Git Bash: - -### Step 2a: Open folder and Git Bash - -Navigate to the folder on your device where you want to clone the repo. Right-click in the directory and select "Git Bash Here". - -![](images/gitbash_here.png){width="343"} - -### Step 2b: Clone the Repository in Git Bash - -- In the Git Bash window that opens, use the \`git clone\` command followed by the URL you copied from GitHub. For this repo, we would enter: - -``` bash -git clone https://github.com/dfe-analytical-services/git-academy-sandbox.git -``` - -You will need to right-click to paste, as the keyboard shortcut will not work in Git Bash and then press enter. - -### Step 2c: Verify the clone in Git Bash - -- Navigate into the repo by typing **cd git-academy-sandbox** and pressing enter. - -- You should now see the current branch name (e.g. main) at the end of the file path as below: - -![](images/git_clone.png){fig-align="center"} - -- Type **git log** and press enter to view recent commits. Press **q** when you are ready to exit git log. -- Type **git status** and press enter to check the state of the cloned repository (at this point, it should say everything is up to date, as you haven't made any changes yet). - -## Or, to Clone Using RStudio: - -### Step 2a: Open RStudio - -Open RStudio on your device. - -### Step 2b: Clone the Repository in RStudio - -- In RStudio, go to **File \> New Project \> Version Control \> Git**. - -- Paste the URL you copied from GitHub into the "Repository URL" field. - -- Choose a directory on your device where you want to save the repo. - -- Click "Create Project". - -![](images/R_clone.png){width="467"} - -### Step 2c: Verify the Clone - -Check the Files pane in RStudio to see if the repo files have been cloned to your local machine. The files pane normally opens in the right-hand bottom corner of RStudio. - -![](images/R_files_post_clone.png) -::: - -## Conclusion - -You have successfully cloned a GitHub repository! Continue on to learn how to create branches. diff --git a/ch2-git-basics/syncing.qmd b/ch2-git-basics/syncing.qmd deleted file mode 100644 index e69de29..0000000 diff --git a/ch3-using-branches/creating-branches.qmd b/ch3-using-branches/creating-branches.qmd deleted file mode 100644 index e69de29..0000000 diff --git a/ch4-merging/reviewing-pull-requests.qmd b/ch4-merging/reviewing-pull-requests.qmd deleted file mode 100644 index e69de29..0000000 diff --git a/ch5-navigating/the-head.qmd b/ch5-navigating/the-head.qmd deleted file mode 100644 index e69de29..0000000 diff --git a/ch6-security/azure-managing-access.qmd b/ch6-security/azure-managing-access.qmd deleted file mode 100644 index e69de29..0000000 diff --git a/ch7-task-management/azure-boards.qmd b/ch7-task-management/azure-boards.qmd deleted file mode 100644 index e69de29..0000000 diff --git a/ch7-task-management/github-issues.qmd b/ch7-task-management/github-issues.qmd deleted file mode 100644 index e69de29..0000000 diff --git a/ch8-automations/github-automated-tests.qmd b/ch8-automations/github-automated-tests.qmd deleted file mode 100644 index e69de29..0000000 diff --git a/git-refresher/clone-a-repo.qmd b/git-refresher/clone-a-repo.qmd index e69de29..0a89dc2 100644 --- a/git-refresher/clone-a-repo.qmd +++ b/git-refresher/clone-a-repo.qmd @@ -0,0 +1,77 @@ +--- +title: "Cloning an Existing Repository" +--- + +--- +## Introduction + +This section will guide you through the process of cloning a GitHub repository (repo). A repo contains all of your code, your files and each file's version history. Repos can have multiple collaborators and can be either private or public. You can find out more about GitHub repos on [GitHub Docs](https://docs.github.com/en/repositories/creating-and-managing-repositories/about-repositories). + +If you have a repo on Azure DevOps, GitHub or GitLab, you generally can't edit or run your work on those platforms, so if you need to work with the contents of a repo, you'll usually need to make a clone. + +There are several ways to clone an existing repo. Below, you'll find two methods. The first uses Rstudio and the second uses Git Bash. Start with step 1, which is the same for both methods, and then decide which method to follow. Once you have successfully cloned, you should see the files appear in the location you have chosen to store your repo. + +## Step 1: Get the repository clone link + +a\. Go to the [git-academy-sandbox](https://github.com/dfe-analytical-services/git-academy-sandbox) repository page on GitHub. + +b\. Click the "Code" button and copy the URL (HTTPS link). + +::: panel-tabset +## To Clone Using Git Bash: + +### Step 2a: Open folder and Git Bash + +Navigate to the folder on your device where you want to clone the repo. Right-click in the directory and select "Git Bash Here". + +![](images/clone_gitbash-here.png){width="343"} + +### Step 2b: Clone the Repository in Git Bash + +- In the Git Bash window that opens, use the \`git clone\` command followed by the URL you copied from GitHub. For this repo, we would enter: + +``` bash +git clone https://github.com/dfe-analytical-services/git-academy-sandbox.git +``` + +You will need to right-click to paste, as the keyboard shortcut will not work in Git Bash and then press enter. + +### Step 2c: Verify the clone in Git Bash + +- Navigate into the repo by typing **cd git-academy-sandbox** and pressing enter. + +- You should now see the current branch name (e.g. main) at the end of the file path as below: + +![](images/clone_gitbash-nav.png){fig-align="center"} + +- Type **git log** and press enter to view recent commits. Press **q** when you are ready to exit git log. +- Type **git status** and press enter to check the state of the cloned repository (at this point, it should say everything is up to date, as you haven't made any changes yet). + +## Or, to Clone Using RStudio: + +### Step 2a: Open RStudio + +Open RStudio on your device. + +### Step 2b: Clone the Repository in RStudio + +- In RStudio, go to **File \> New Project \> Version Control \> Git**. + +- Paste the URL you copied from GitHub into the "Repository URL" field. + +- Choose a directory on your device where you want to save the repo. + +- Click "Create Project". + +![](images/clone_rstudio-here.png){width="467"} + +### Step 2c: Verify the Clone + +Check the Files pane in RStudio to see if the repo files have been cloned to your local machine. The files pane normally opens in the right-hand bottom corner of RStudio. + +![](images/clone_rstudio-files.png) +::: + +## Conclusion + +You have successfully cloned a GitHub repository! Continue on to learn how to create branches. diff --git a/ch2-git-basics/images/gitbash_here.png b/git-refresher/images/clone_gitbash-here.png similarity index 100% rename from ch2-git-basics/images/gitbash_here.png rename to git-refresher/images/clone_gitbash-here.png diff --git a/ch2-git-basics/images/git_clone.png b/git-refresher/images/clone_gitbash-nav.png similarity index 100% rename from ch2-git-basics/images/git_clone.png rename to git-refresher/images/clone_gitbash-nav.png diff --git a/ch2-git-basics/images/R_files_post_clone.png b/git-refresher/images/clone_rstudio-files.png similarity index 100% rename from ch2-git-basics/images/R_files_post_clone.png rename to git-refresher/images/clone_rstudio-files.png diff --git a/ch2-git-basics/images/R_clone.png b/git-refresher/images/clone_rstudio.png similarity index 100% rename from ch2-git-basics/images/R_clone.png rename to git-refresher/images/clone_rstudio.png diff --git a/git-refresher/images/new-branch-GitHubDesktop.png b/git-refresher/images/new-branch_GitHubDesktop.png similarity index 100% rename from git-refresher/images/new-branch-GitHubDesktop.png rename to git-refresher/images/new-branch_GitHubDesktop.png diff --git a/git-refresher/images/new-branch-PyCharm.png b/git-refresher/images/new-branch_PyCharm.png similarity index 100% rename from git-refresher/images/new-branch-PyCharm.png rename to git-refresher/images/new-branch_PyCharm.png diff --git a/git-refresher/images/new-branch-RStudio.png b/git-refresher/images/new-branch_RStudio.png similarity index 100% rename from git-refresher/images/new-branch-RStudio.png rename to git-refresher/images/new-branch_RStudio.png diff --git a/git-refresher/images/new-branch-VSCode.png b/git-refresher/images/new-branch_VSCode.png similarity index 100% rename from git-refresher/images/new-branch-VSCode.png rename to git-refresher/images/new-branch_VSCode.png diff --git a/git-refresher/images/RStudio-newbranch-button.png b/git-refresher/images/new-branch_rstudio-button.png similarity index 100% rename from git-refresher/images/RStudio-newbranch-button.png rename to git-refresher/images/new-branch_rstudio-button.png