-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from dfe-analytical-services/20-exploring-a-re…
…pository-on-github 20 exploring a repository on GitHub
- Loading branch information
Showing
20 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Version: 1.0 | ||
ProjectId: d79d2004-dbcd-4aca-af7c-895ab685fe25 | ||
|
||
RestoreWorkspace: Default | ||
SaveWorkspace: Default | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: "Editing a file on GitHub" | ||
--- | ||
|
||
|
||
In this section, we’ll walk through the steps to edit a file on GitHub. We’ll use the example of editing the git-academy-log.md file in the github-sandbox repository. This process can be applied to any file in any repository. | ||
|
||
1. Ensure you are still on the GitHub site for the github-sandbox repository. | ||
|
||
2. Check you are on your `<github_username>/main` branch by using the branches drop-down. | ||
|
||
3. Locate the git-academy-log.md file and click on it as below: | ||
|
||
![](images/git_log.png){fig-alt="Screenshot of the git-academy-sandbox repository on GitHub, with the lsnaathorst-main branch selected and the git-academy-log.md being selected."} | ||
|
||
4. Click the pencil icon (✏️), usually located on the right-hand side, to edit the file. | ||
|
||
![](images/edit_file.png){fig-alt="Screenshot of the git-academy-sandbox repository on GitHub, showing the git-academy-log.md file and the pencil icon (✏️) for editing the file."} | ||
|
||
5. Put an 'X' in each box under 'Exploring a repository' on GitHub. | ||
|
||
![](images/x_in_exploring_boxes.png){fig-alt="Screenshot of the git-academy-log.md file on GitHub with an 'x' added to all instances of 'exploring a repository."} | ||
|
||
6. Find the 'Commit changes' button, normally at the top right of the page. | ||
|
||
![](images/commit_changes_button.png){fig-alt="Screenshot of the 'Commit changes' button on the git-academy-log.md file on GitHub, which shoes after making changes in edit mode."} | ||
|
||
7. Enter a commit message describing the changes. | ||
|
||
8. Click 'Commit changes' to save your edits and create a new commit. When you view the git-academy-log file, you should see that the boxes under 'Exploring a repository on Github' are now ticked. | ||
|
||
::: {.callout-important} | ||
To view the online changes that you have made locally, you will need to pull. This ensures that your local repository is up-to-date with the latest changes from the online repository. | ||
::: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: "Switching branches on GitHub" | ||
--- | ||
|
||
To view and switch between the different branches available in a GitHub repository, follow these steps: | ||
|
||
1. Navigate to the repository on GitHub. In this case, [Git-academy-sandbox](https://github.com/dfe-analytical-services/git-academy-sandbox){target="_blank"}. | ||
|
||
2. Click on the 'Branches' button below the title of the repository as below: | ||
|
||
![](images/view_branches_in_GitHub.png){fig-alt="Screenshot of the git-academy-sandbox repository main page, highlighting the 'Branches' button."} | ||
|
||
3. A list of all of the branches in the repository which have been synced to the remote will be shown. You can select any branch to view its contents. You can search branches using the search box or just see your own, active or stale branches by moving through the tabs. | ||
|
||
::: {.callout-note} | ||
## Default Branch | ||
The default branch is like the main version of your project. It's usually called main, but sometimes it might have a different name. This is the branch where the latest, most stable version of your project lives. When you want to make changes to code, you usually create your own branch from main. | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: "Viewing a file on GitHub" | ||
--- | ||
|
||
To view a file on your repo: | ||
|
||
1. Ensure you are still on the GitHub site for the github-sandbox repository. | ||
|
||
2. Navigate to the 'code' tab at the top of the page. | ||
|
||
![](images/repo_code_tab.png){fig-alt="Screenshot of the git-academy-sandbox repository on GitHub, highlighting the 'Code' tab."} | ||
|
||
3. Find and select the branch you previously created i.e. `<github_id>/main`. You can do this by clicking on the branches button and selecting your branch, or using the branch drop-down as below to click on your branch: | ||
|
||
|
||
![](images/viewing_branches_drop_down.png){fig-alt="Screenshot of the git-academy-sandbox repository on GitHub, displaying the branches drop-down menu with 'main' selected."} | ||
|
||
4. Once you have selected your branch, the drop-down will change to show your branch name as below: | ||
|
||
![](images/branch_highlighted.png){fig-alt="Screenshot of the git-academy-sandbox repository on GitHub, displaying the branches drop-down menu with 'lsnaathorst1/main' selected."} | ||
|
||
5. Click on a file to view the most up-to-date synced code for the branch you have selected. | ||
|
||
6. Once you have clicked on a file, you can navigate through different files, change branches or search for a file using Files pane. | ||
|
||
![](images/files_pane.png){fig-alt="Screenshot of the git-academy-sandbox repository on GitHub, displaying the files pane as seen when viewing files in a branch."} | ||
|
||
7. Each file will have a sub-set of the following views available to select above it: preview, code and blame. You will need to switch to the code view to see and edit the raw contents of the file. The preview view will show you a preview for supported files like Markdown and Quarto and the blame view shows line by line revision history, tracking who made each change and when. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: "Viewing history on GitHub" | ||
--- | ||
|
||
1. Ensure you are still on the GitHub site for the github-sandbox repository. | ||
|
||
2. Select the branch you would like to see history for from the 'Branch' drop down menu, in this case, the `<github_id>/main` branch you created. | ||
|
||
![](images/viewing_branches_drop_down.png){fig-alt="Image shows a screengrab of the git-academy-sandbox repository, with the branches drop-down selected"} | ||
|
||
3. Click on the 'Commits' button, usually found near the top of the repository page. | ||
|
||
![](images/commits_button.png){fig-alt="Screenshot of the git-academy-sandbox repository, highlighting the 'Commits' button that appears when a branch is selected."} | ||
|
||
4. A list of all commits made to the branch will be displayed. You'll also be able to see the commits made to the main branch from which your branch was created. | ||
|
||
![](images/commit_list.png){fig-alt="Screenshot of the git-academy-sandbox repository, showing the commit list for the selected branch."} | ||
|
||
5. You can click on each commit to see the history of the branch. You are able to see the date each commit was made, the files and changes made and any commit messages. | ||
|