From 889f72787b754aae2cd6b7a173085fbcb2e7edf0 Mon Sep 17 00:00:00 2001 From: 0071650806 Date: Tue, 4 Jun 2024 08:17:04 +0330 Subject: [PATCH] Delete content/repositories/working-with-files directory --- .../repositories/working-with-files/index.md | 21 - .../adding-a-file-to-a-repository.md | 91 ----- .../managing-files/creating-new-files.md | 39 -- ...zing-how-changed-files-appear-on-github.md | 30 -- .../deleting-files-in-a-repository.md | 52 --- .../managing-files/editing-files.md | 56 --- .../managing-files/index.md | 23 -- .../moving-a-file-to-a-new-location.md | 99 ----- .../managing-files/renaming-a-file.md | 77 ---- .../about-git-large-file-storage.md | 60 --- .../about-large-files-on-github.md | 117 ------ .../about-storage-and-bandwidth-usage.md | 49 --- ...llaboration-with-git-large-file-storage.md | 49 --- .../configuring-git-large-file-storage.md | 76 ---- .../managing-large-files/index.md | 26 -- .../installing-git-large-file-storage.md | 129 ------- ...ur-repository-to-git-large-file-storage.md | 31 -- ...oving-files-from-git-large-file-storage.md | 58 --- ...-git-large-file-storage-upload-failures.md | 29 -- .../downloading-source-code-archives.md | 71 ---- .../getting-permanent-links-to-files.md | 56 --- .../working-with-files/using-files/index.md | 15 - .../using-files/navigating-code-on-github.md | 121 ------ .../using-files/viewing-a-file.md | 105 ----- .../working-with-non-code-files.md | 358 ------------------ 25 files changed, 1838 deletions(-) delete mode 100644 content/repositories/working-with-files/index.md delete mode 100644 content/repositories/working-with-files/managing-files/adding-a-file-to-a-repository.md delete mode 100644 content/repositories/working-with-files/managing-files/creating-new-files.md delete mode 100644 content/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github.md delete mode 100644 content/repositories/working-with-files/managing-files/deleting-files-in-a-repository.md delete mode 100644 content/repositories/working-with-files/managing-files/editing-files.md delete mode 100644 content/repositories/working-with-files/managing-files/index.md delete mode 100644 content/repositories/working-with-files/managing-files/moving-a-file-to-a-new-location.md delete mode 100644 content/repositories/working-with-files/managing-files/renaming-a-file.md delete mode 100644 content/repositories/working-with-files/managing-large-files/about-git-large-file-storage.md delete mode 100644 content/repositories/working-with-files/managing-large-files/about-large-files-on-github.md delete mode 100644 content/repositories/working-with-files/managing-large-files/about-storage-and-bandwidth-usage.md delete mode 100644 content/repositories/working-with-files/managing-large-files/collaboration-with-git-large-file-storage.md delete mode 100644 content/repositories/working-with-files/managing-large-files/configuring-git-large-file-storage.md delete mode 100644 content/repositories/working-with-files/managing-large-files/index.md delete mode 100644 content/repositories/working-with-files/managing-large-files/installing-git-large-file-storage.md delete mode 100644 content/repositories/working-with-files/managing-large-files/moving-a-file-in-your-repository-to-git-large-file-storage.md delete mode 100644 content/repositories/working-with-files/managing-large-files/removing-files-from-git-large-file-storage.md delete mode 100644 content/repositories/working-with-files/managing-large-files/resolving-git-large-file-storage-upload-failures.md delete mode 100644 content/repositories/working-with-files/using-files/downloading-source-code-archives.md delete mode 100644 content/repositories/working-with-files/using-files/getting-permanent-links-to-files.md delete mode 100644 content/repositories/working-with-files/using-files/index.md delete mode 100644 content/repositories/working-with-files/using-files/navigating-code-on-github.md delete mode 100644 content/repositories/working-with-files/using-files/viewing-a-file.md delete mode 100644 content/repositories/working-with-files/using-files/working-with-non-code-files.md diff --git a/content/repositories/working-with-files/index.md b/content/repositories/working-with-files/index.md deleted file mode 100644 index a01794d23e59..000000000000 --- a/content/repositories/working-with-files/index.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: Working with files -intro: Learn how to manage and use files in repositories. -redirect_from: - - /categories/81/articles - - /categories/manipulating-files - - /categories/managing-files-in-a-repository - - /github/managing-files-in-a-repository -versions: - fpt: '*' - ghes: '*' - ghec: '*' -topics: - - Repositories -children: - - /managing-files - - /using-files - - /managing-large-files -shortTitle: Work with files ---- - diff --git a/content/repositories/working-with-files/managing-files/adding-a-file-to-a-repository.md b/content/repositories/working-with-files/managing-files/adding-a-file-to-a-repository.md deleted file mode 100644 index bb114a4b365f..000000000000 --- a/content/repositories/working-with-files/managing-files/adding-a-file-to-a-repository.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: Adding a file to a repository -intro: 'You can upload and commit an existing file to a repository on {% data variables.product.product_name %} or by using the command line.' -redirect_from: - - /articles/adding-a-file-to-a-repository - - /github/managing-files-in-a-repository/adding-a-file-to-a-repository - - /articles/adding-a-file-to-a-repository-from-the-command-line - - /articles/adding-a-file-to-a-repository-using-the-command-line - - /github/managing-files-in-a-repository/adding-a-file-to-a-repository-using-the-command-line - - /github/managing-files-in-a-repository/managing-files-on-github/adding-a-file-to-a-repository - - /github/managing-files-in-a-repository/managing-files-using-the-command-line/adding-a-file-to-a-repository-using-the-command-line - - /github/managing-large-files/about-large-files-on-github -versions: - fpt: '*' - ghes: '*' - ghec: '*' -topics: - - Repositories -shortTitle: Add a file ---- - -## Adding a file to a repository on {% data variables.product.product_name %} - -Files that you add to a repository via a browser are limited to {% data variables.large_files.max_github_browser_size %} per file. You can add larger files, up to {% data variables.large_files.max_github_size %} each, via the command line. For more information, see "[Adding a file to a repository using the command line](#adding-a-file-to-a-repository-using-the-command-line)." To add files larger than {% data variables.large_files.max_github_size %}, you must use {% data variables.large_files.product_name_long %}. For more information, see "[AUTOTITLE](/repositories/working-with-files/managing-large-files/about-large-files-on-github)." - -You can upload multiple files to {% data variables.product.product_name %} at the same time. - -{% data reusables.repositories.protected-branches-block-web-edits-uploads %} - -{% ifversion push-rulesets %} - -{% data reusables.repositories.rulesets-push-rules-general-info-for-related-articles %} - -{% endif %} - -{% ifversion push-protection-block-uploads %} - -Your repository may be secured by push protection. With push protection, {% data variables.product.prodname_dotcom %} will block uploading a file to the repository if the file contains a supported secret, such as a token. You should remove the secret from the file before attempting to upload the file again. For more information, see "[AUTOTITLE](/code-security/secret-scanning/working-with-push-protection#using-push-protection-from-the-web-ui)" and "[AUTOTITLE](/code-security/secret-scanning/pushing-a-branch-blocked-by-push-protection#resolving-a-blocked-commit-in-the-web-ui)." - -{% data reusables.secret-scanning.push-protection-web-UI-uploads-beta %} - -{% endif %} - -{% data reusables.repositories.navigate-to-repo %} -1. Above the list of files, select the **Add file** dropdown menu and click **Upload files**. Alternatively, you can drag and drop files into your browser. - - ![Screenshot of the main page of the repository. Above the list of a files, a button, labeled "Add file," is outlined in dark orange.](/assets/images/help/repository/upload-files-button.png) -1. To select the files you want to upload, drag and drop the file or folder, or click **choose your files**. -{% data reusables.files.commit-message %} -{% data reusables.files.choose_commit_branch %} -1. Click **Propose changes**. - -## Adding a file to a repository using the command line - -You can upload an existing file to a repository on {% data variables.location.product_location %} using the command line. - -{% tip %} - -**Tip:** You can also [add an existing file to a repository from the {% data variables.product.product_name %} website](/repositories/working-with-files/managing-files/adding-a-file-to-a-repository). - -{% endtip %} - -{% data reusables.command_line.manipulating_file_prereqs %} - -{% data reusables.repositories.sensitive-info-warning %} - -1. On your computer, move the file you'd like to upload to {% data variables.product.product_name %} into the local directory that was created when you cloned the repository. -{% data reusables.command_line.open_the_multi_os_terminal %} -{% data reusables.command_line.switching_directories_procedural %} -{% data reusables.git.stage_for_commit %} - - ```shell - $ git add . - # Adds the file to your local repository and stages it for commit. {% data reusables.git.unstage-codeblock %} - ``` - -{% data reusables.git.commit-file %} - - ```shell - $ git commit -m "Add existing file" - # Commits the tracked changes and prepares them to be pushed to a remote repository. {% data reusables.git.reset-head-to-previous-commit-codeblock %} - ``` - -{% data reusables.git.git-push %} - -{% ifversion fpt or ghec %} - -## Further reading - -- "[AUTOTITLE](/migrations/importing-source-code/using-the-command-line-to-import-source-code/adding-locally-hosted-code-to-github)" -{% endif %} diff --git a/content/repositories/working-with-files/managing-files/creating-new-files.md b/content/repositories/working-with-files/managing-files/creating-new-files.md deleted file mode 100644 index b642082e0f74..000000000000 --- a/content/repositories/working-with-files/managing-files/creating-new-files.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: Creating new files -intro: 'You can create new files directly on {% data variables.product.product_name %} in any repository you have write access to.' -redirect_from: - - /articles/creating-new-files - - /github/managing-files-in-a-repository/creating-new-files - - /github/managing-files-in-a-repository/managing-files-on-github/creating-new-files -versions: - fpt: '*' - ghes: '*' - ghec: '*' -topics: - - Repositories ---- -When creating a file on {% data variables.product.product_name %}, consider the following: - -- If you try to create a new file in a repository that you don’t have access to, we will fork the project to your personal account and help you send [a pull request](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) to the original repository after you commit your change. -- File names created via the web interface can only contain alphanumeric characters and hyphens (`-`). To use other characters, [create and commit the files locally, then push them to the repository on {% data variables.product.product_name %}](/repositories/working-with-files/managing-files/adding-a-file-to-a-repository). -{%- ifversion push-rulesets %} -- {% data reusables.repositories.rulesets-push-rules-general-info-for-related-articles %} -{% endif %} - -{% data reusables.repositories.sensitive-info-warning %} - -{% data reusables.repositories.navigate-to-repo %} -1. In your repository, browse to the folder where you want to create a file. -{% data reusables.files.add-file %} -1. In the file name field, type the name and extension for the file. To create subdirectories, type the `/` directory separator. -1. In the file contents text box, type content for the file. -1. To review the new content, above the file contents, click **Preview**. -{% ifversion code-view-ui %} - ![Screenshot of a file in edit mode. Above the text box for editing file contents, a tab, labeled "Preview", outlined in dark orange.](/assets/images/help/repository/new-file-preview.png) -{% else %} - ![Screenshot of a file in edit mode. Above the text box for editing file contents, a tab, labeled "Preview", outlined in dark orange.](/assets/images/enterprise/repository/new-file-preview.png) -{% endif %} -{% data reusables.files.write_commit_message %} -{% data reusables.files.choose-commit-email %} -{% data reusables.files.choose_commit_branch %} -{% data reusables.files.propose_new_file %} diff --git a/content/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github.md b/content/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github.md deleted file mode 100644 index b7636235cf6c..000000000000 --- a/content/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Customizing how changed files appear on GitHub -intro: 'To keep certain files from displaying in diffs by default, or counting toward the repository language, you can mark them with the `linguist-generated` attribute in a *.gitattributes* file.' -redirect_from: - - /articles/customizing-how-changed-files-appear-on-github - - /github/administering-a-repository/customizing-how-changed-files-appear-on-github - - /github/administering-a-repository/managing-repository-settings/customizing-how-changed-files-appear-on-github -versions: - fpt: '*' - ghes: '*' - ghec: '*' -topics: - - Repositories -shortTitle: How changed files appear ---- -Use a _.gitattributes_ file to mark files that match a given "pattern" with the specified attributes. A _.gitattributes_ file uses the same rules for matching as _.gitignore_ files. For more information, see [PATTERN FORMAT](https://www.git-scm.com/docs/gitignore#_pattern_format) in the Git documentation. - -1. Unless the _.gitattributes_ file already exists, create a _.gitattributes_ file in the root of the repository. -1. Use the `linguist-generated` attribute to mark or unmark paths that you would like to be ignored for the repository's language statistics and hidden by default in diffs. - - For example, to mark `search/index.json` as a generated file, add this line to _.gitattributes_: - - ```text - search/index.json linguist-generated=true - ``` - -## Further reading - -- "[Generated code](https://github.com/github-linguist/linguist/blob/master/docs/overrides.md#generated-code)" in the Linguist documentation -- "[AUTOTITLE](/repositories/working-with-files/managing-files/creating-new-files)" diff --git a/content/repositories/working-with-files/managing-files/deleting-files-in-a-repository.md b/content/repositories/working-with-files/managing-files/deleting-files-in-a-repository.md deleted file mode 100644 index f60d6070c43f..000000000000 --- a/content/repositories/working-with-files/managing-files/deleting-files-in-a-repository.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: Deleting files in a repository -intro: 'You can delete an individual file or an entire directory in your repository on {% data variables.product.product_name %}.' -redirect_from: - - /articles/deleting-files - - /github/managing-files-in-a-repository/deleting-files - - /github/managing-files-in-a-repository/deleting-a-file-or-directory - - /github/managing-files-in-a-repository/deleting-files-in-a-repository - - /github/managing-files-in-a-repository/managing-files-on-github/deleting-files-in-a-repository -versions: - fpt: '*' - ghes: '*' - ghec: '*' -permissions: 'People with write permissions can delete files or directories in a repository.' -topics: - - Repositories -shortTitle: Delete files ---- -## About file and directory deletion - -You can delete an individual file in your repository or an entire directory, including all the files in the directory. - -If you try to delete a file or directory in a repository that you don’t have write permissions to, we'll fork the project to your personal account and help you send a pull request to the original repository after you commit your change. For more information, see "[AUTOTITLE](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)." - -If the file or directory you deleted contains sensitive data, the data will still be available in the repository's Git history. To completely remove the file from {% data variables.product.product_name %}, you must remove the file from your repository's history. For more information, see "[AUTOTITLE](/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository)." - -## Deleting a file - -1. Browse to the file in your repository that you want to delete. -{% ifversion code-view-ui %} -1. In the top-right corner, select the {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %} dropdown menu, then click **Delete file**. - - ![Screenshot of the file list for a directory. To the right of the directory name, a button, labeled with a kebab icon, is outlined in dark orange.](/assets/images/help/repository/delete-file-button.png) -{% else %} -1. At the top of the file, click {% octicon "trash" aria-label="The trash icon" %}. -{% endif %} -{% data reusables.files.commit-message %} -{% data reusables.files.choose-commit-email %} -{% data reusables.files.choose_commit_branch %} -{% data reusables.files.propose_file_change %} - -## Deleting a directory - -1. Browse to the directory in your repository that you want to delete. -1. In the top-right corner, select the {% octicon "kebab-horizontal" aria-label="More options" %} dropdown menu, then click **Delete directory**. - - ![Screenshot of the file list for a directory. To the right of the directory name, a button, labeled with a kebab icon, is outlined in dark orange.](/assets/images/help/repository/delete-directory-button.png) -1. Review the files you will delete. -{% data reusables.files.commit-message %} -{% data reusables.files.choose-commit-email %} -{% data reusables.files.choose_commit_branch %} -{% data reusables.files.propose_file_change %} diff --git a/content/repositories/working-with-files/managing-files/editing-files.md b/content/repositories/working-with-files/managing-files/editing-files.md deleted file mode 100644 index f54714dea43d..000000000000 --- a/content/repositories/working-with-files/managing-files/editing-files.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: Editing files -intro: 'You can edit files directly on {% data variables.product.product_name %} in any of your repositories using the file editor.' -redirect_from: - - /articles/editing-files - - /articles/editing-files-in-your-repository - - /github/managing-files-in-a-repository/editing-files-in-your-repository - - /articles/editing-files-in-another-user-s-repository - - /github/managing-files-in-a-repository/editing-files-in-another-users-repository - - /github/managing-files-in-a-repository/managing-files-on-github/editing-files-in-your-repository - - /github/managing-files-in-a-repository/managing-files-on-github/editing-files-in-another-users-repository -versions: - fpt: '*' - ghes: '*' - ghec: '*' -topics: - - Repositories -shortTitle: Edit files ---- - -## Editing files in your repository - -{% tip %} - -**Tip**: {% data reusables.repositories.protected-branches-block-web-edits-uploads %} - -{% endtip %} - -{% note %} - -**Note:** {% data variables.product.product_name %}'s file editor uses [CodeMirror](https://codemirror.net/). - -{% endnote %} - -1. In your repository, browse to the file you want to edit. -{% data reusables.repositories.edit-file %} -1. In the text box, make any changes you need to the file. -{% data reusables.files.preview_change %} -{% data reusables.files.write_commit_message %} -{% data reusables.files.choose-commit-email %} -{% data reusables.files.choose_commit_branch %} -{% data reusables.files.propose_file_change %} - -## Editing files in another user's repository - -When you edit a file in another user's repository, we'll automatically [fork the repository](/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) and [open a pull request](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) for you. - -1. In another user's repository, browse to the folder that contains the file you want to edit. Click the name of the file you want to edit. -1. Above the file content, click {% octicon "pencil" aria-label="Edit file" %}. At this point, {% data variables.product.prodname_dotcom %} forks the repository for you. -1. In the text box, make any changes you need to the file. -{% data reusables.files.preview_change %} -{% data reusables.files.write_commit_message %} -{% data reusables.files.choose-commit-email %} -1. Click **Propose changes**. -1. Type a title and description for your pull request. -1. Click **Create pull request**. diff --git a/content/repositories/working-with-files/managing-files/index.md b/content/repositories/working-with-files/managing-files/index.md deleted file mode 100644 index 97fa660d3bb0..000000000000 --- a/content/repositories/working-with-files/managing-files/index.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: Managing files -intro: 'You can create, edit, move, and delete files in a repository, directly on {% data variables.product.product_name %} or on the command line.' -redirect_from: - - /articles/managing-files-on-github - - /github/managing-files-in-a-repository/managing-files-on-github - - /github/managing-files-in-a-repository/managing-files-using-the-command-line -versions: - fpt: '*' - ghes: '*' - ghec: '*' -topics: - - Repositories -children: - - /creating-new-files - - /adding-a-file-to-a-repository - - /moving-a-file-to-a-new-location - - /editing-files - - /renaming-a-file - - /deleting-files-in-a-repository - - /customizing-how-changed-files-appear-on-github ---- - diff --git a/content/repositories/working-with-files/managing-files/moving-a-file-to-a-new-location.md b/content/repositories/working-with-files/managing-files/moving-a-file-to-a-new-location.md deleted file mode 100644 index 8017d0c3f1ec..000000000000 --- a/content/repositories/working-with-files/managing-files/moving-a-file-to-a-new-location.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: Moving a file to a new location -intro: 'You can move a file to a different directory on {% data variables.product.product_name %} or by using the command line.' -redirect_from: - - /articles/moving-a-file-to-a-new-location - - /github/managing-files-in-a-repository/moving-a-file-to-a-new-location - - /articles/moving-a-file-to-a-new-location-using-the-command-line - - /github/managing-files-in-a-repository/moving-a-file-to-a-new-location-using-the-command-line - - /github/managing-files-in-a-repository/managing-files-on-github/moving-a-file-to-a-new-location - - /github/managing-files-in-a-repository/managing-files-using-the-command-line/moving-a-file-to-a-new-location-using-the-command-line -versions: - fpt: '*' - ghes: '*' - ghec: '*' -topics: - - Repositories -shortTitle: Move a file ---- -In addition to changing the file location, you can also [update the contents of your file](/repositories/working-with-files/managing-files/editing-files), or [give it a new name](/repositories/working-with-files/managing-files/renaming-a-file) in the same commit. - -## Moving a file to a new location on {% data variables.product.product_name %} - -{% tip %} - -**Tips**: - -- If you try to move a file in a repository that you don’t have access to, we'll fork the project to your personal account and help you send [a pull request](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) to the original repository after you commit your change. -- Some files, such as images, require that you move them from the command line. For more information, see "[AUTOTITLE](/repositories/working-with-files/managing-files/moving-a-file-to-a-new-location)". -- {% data reusables.repositories.protected-branches-block-web-edits-uploads %} - -{% endtip %} - -1. In your repository, browse to the file you want to move. -{% data reusables.repositories.edit-file %} -1. In the filename field, change the name of the file using these guidelines: - - To move the file **into a subfolder**, type the name of the folder you want, followed by `/`. Your new folder name becomes a new item in the navigation breadcrumbs. - - To move the file into a directory **above the file's current location**, place your cursor at the beginning of the filename field, then either type `../` to jump up one full directory level, or type the `backspace` key to edit the parent folder's name. -{% data reusables.files.write_commit_message %} -{% data reusables.files.choose_commit_branch %} -{% data reusables.files.propose_file_change %} - -## Moving a file to a new location using the command line - -You can use the command line to move files within a repository by removing the file from the old location and then adding it in the new location. - -Many files can be [moved directly on {% data variables.product.product_name %}](/repositories/working-with-files/managing-files/moving-a-file-to-a-new-location), but some files, such as images, require that you move them from the command line. - -{% data reusables.command_line.manipulating_file_prereqs %} - -1. On your computer, move the file to a new location within the directory that was created locally on your computer when you cloned the repository. -{% data reusables.command_line.open_the_multi_os_terminal %} -1. Use `git status` to check the old and new file locations. - - ```shell - $ git status - > # On branch YOUR-BRANCH - > # Changes not staged for commit: - > # (use "git add/rm ..." to update what will be committed) - > # (use "git checkout -- ..." to discard changes in working directory) - > # - > # deleted: /OLD-FOLDER/IMAGE.PNG - > # - > # Untracked files: - > # (use "git add ..." to include in what will be committed) - > # - > # /NEW-FOLDER/IMAGE.PNG - > # - > # no changes added to commit (use "git add" and/or "git commit -a") - ``` - -{% data reusables.git.stage_for_commit %} This will delete, or `git rm`, the file from the old location and add, or `git add`, the file to the new location. - - ```shell - $ git add . - # Adds the file to your local repository and stages it for commit. - # {% data reusables.git.unstage-codeblock %} - ``` - -1. Use `git status` to check the changes staged for commit. - - ```shell - $ git status - > # On branch YOUR-BRANCH - > # Changes to be committed: - > # (use "git reset HEAD ..." to unstage) - > # - > # renamed: /old-folder/image.png -> /new-folder/image.png - # Displays the changes staged for commit - ``` - -{% data reusables.git.commit-file %} - - ```shell - $ git commit -m "Move file to new directory" - # Commits the tracked changes and prepares them to be pushed to a remote repository. - # {% data reusables.git.reset-head-to-previous-commit-codeblock %} - ``` - -{% data reusables.git.git-push %} diff --git a/content/repositories/working-with-files/managing-files/renaming-a-file.md b/content/repositories/working-with-files/managing-files/renaming-a-file.md deleted file mode 100644 index f016436fc365..000000000000 --- a/content/repositories/working-with-files/managing-files/renaming-a-file.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: Renaming a file -intro: 'You can rename any file in your repository directly in {% data variables.product.product_name %} or by using the command line.' -redirect_from: - - /articles/renaming-a-file - - /github/managing-files-in-a-repository/renaming-a-file - - /articles/renaming-a-file-using-the-command-line - - /github/managing-files-in-a-repository/renaming-a-file-using-the-command-line - - /github/managing-files-in-a-repository/managing-files-on-github/renaming-a-file - - /github/managing-files-in-a-repository/managing-files-using-the-command-line/renaming-a-file-using-the-command-line -versions: - fpt: '*' - ghes: '*' - ghec: '*' -topics: - - Repositories ---- - -## Renaming a file on {% data variables.product.product_name %} - -Renaming a file also gives you the opportunity to [move the file to a new location](/repositories/working-with-files/managing-files/moving-a-file-to-a-new-location) - -{% tip %} - -**Tips**: - -- If you try to rename a file in a repository that you don’t have access to, we will fork the project to your personal account and help you send [a pull request](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) to the original repository after you commit your change. -- File names created via the web interface can only contain alphanumeric characters and hyphens (`-`). To use other characters, create and commit the files locally and then push them to the repository. -- Some files, such as images, require that you rename them from the command line. For more information, see "[Renaming a file using the command line](#renaming-a-file-using-the-command-line)." - -{% endtip %} - -1. In your repository, browse to the file you want to rename. -{% data reusables.repositories.edit-file-button %} -1. In the filename field, change the name of the file to the new filename you want. You can also update the contents of your file at the same time. -![Screenshot showing a repository file open for editing in the web browser. The file name field is active and highlighted with a dark orange outline.](/assets/images/help/repository/changing-file-name.png) -{% data reusables.files.write_commit_message %} -{% data reusables.files.choose_commit_branch %} -{% data reusables.files.propose_file_change %} - -## Renaming a file using the command line - -You can use the command line to rename any file in your repository. - -Many files can be renamed directly on {% data variables.product.product_name %}, but some files, such as images, require that you rename them from the command line. - -{% data reusables.command_line.manipulating_file_prereqs %} - -{% data reusables.command_line.open_the_multi_os_terminal %} -{% data reusables.command_line.switching_directories_procedural %} -1. Rename the file, specifying the old file name and the new name you'd like to give the file. This will stage your change for commit. - - ```shell - git mv OLD-FILENAME NEW-FILENAME - ``` - -1. Use `git status` to check the old and new file names. - - ```shell - $ git status - > # On branch YOUR-BRANCH - > # Changes to be committed: - > # (use "git reset HEAD ..." to unstage) - > # - > # renamed: OLD-FILENAME -> NEW-FILENAME - > # - ``` - -{% data reusables.git.commit-file %} - - ```shell - $ git commit -m "Rename file" - # Commits the tracked changes and prepares them to be pushed to a remote repository. - # {% data reusables.git.reset-head-to-previous-commit-codeblock %} - ``` - -{% data reusables.git.git-push %} diff --git a/content/repositories/working-with-files/managing-large-files/about-git-large-file-storage.md b/content/repositories/working-with-files/managing-large-files/about-git-large-file-storage.md deleted file mode 100644 index b7301e948d12..000000000000 --- a/content/repositories/working-with-files/managing-large-files/about-git-large-file-storage.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: About Git Large File Storage -intro: '{% data variables.product.product_name %} limits the size of files allowed in repositories. To track files beyond this limit, you can use {% data variables.large_files.product_name_long %}.' -redirect_from: - - /articles/about-large-file-storage - - /articles/about-git-large-file-storage - - /github/managing-large-files/about-git-large-file-storage - - /github/managing-large-files/versioning-large-files/about-git-large-file-storage -versions: - fpt: '*' - ghes: '*' - ghec: '*' -shortTitle: Git Large File Storage ---- - -## About {% data variables.large_files.product_name_long %} - -{% data variables.large_files.product_name_short %} handles large files by storing references to the file in the repository, but not the actual file itself. To work around Git's architecture, {% data variables.large_files.product_name_short %} creates a pointer file which acts as a reference to the actual file (which is stored somewhere else). {% data variables.product.product_name %} manages this pointer file in your repository. When you clone the repository down, {% data variables.product.product_name %} uses the pointer file as a map to go and find the large file for you. - -{% ifversion fpt or ghec %} -Different maximum size limits for {% data variables.large_files.product_name_short %} apply depending on your {% data variables.product.prodname_dotcom %} plan. - -| Product | Maximum file size | -|------- | ------- | -| {% data variables.product.prodname_free_user %} | 2 GB | -| {% data variables.product.prodname_pro %} | 2 GB | -| {% data variables.product.prodname_team %} | 4 GB | -| {% data variables.product.prodname_ghe_cloud %} | 5 GB |{% else %} -Using {% data variables.large_files.product_name_short %}, you can store files up to 5 GB in your repository. -{% endif %} - -{% data reusables.repositories.git-lfs %} - -You can also use {% data variables.large_files.product_name_short %} with {% data variables.product.prodname_desktop %}. For more information about cloning Git LFS repositories in {% data variables.product.prodname_desktop %}, see "[AUTOTITLE](/desktop/adding-and-cloning-repositories/cloning-a-repository-from-github-to-github-desktop)." - -{% data reusables.large_files.can-include-lfs-objects-archives %} - -## Pointer file format - -{% data variables.large_files.product_name_short %}'s pointer file looks like this: - -```text -version {% data variables.large_files.version_name %} -oid sha256:4cac19622fc3ada9c0fdeadb33f88f367b541f38b89102a3f1261ac81fd5bcb5 -size 84977953 -``` - -It tracks the `version` of {% data variables.large_files.product_name_short %} you're using, followed by a unique identifier for the file (`oid`). It also stores the `size` of the final file. - -{% note %} - -**Notes**: -- {% data variables.large_files.product_name_short %} cannot be used with {% data variables.product.prodname_pages %} sites. -- {% data variables.large_files.product_name_short %} cannot be used with template repositories. - -{% endnote %} - -## Further reading - -- "[AUTOTITLE](/repositories/working-with-files/managing-large-files/collaboration-with-git-large-file-storage)" diff --git a/content/repositories/working-with-files/managing-large-files/about-large-files-on-github.md b/content/repositories/working-with-files/managing-large-files/about-large-files-on-github.md deleted file mode 100644 index e509cb50e6e2..000000000000 --- a/content/repositories/working-with-files/managing-large-files/about-large-files-on-github.md +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: About large files on GitHub -intro: '{% data variables.product.product_name %} limits the size of files you can track in regular Git repositories. Learn how to track or remove files that are beyond the limit.' -redirect_from: - - /articles/distributing-large-binaries - - /github/managing-large-files/distributing-large-binaries - - /github/managing-large-files/working-with-large-files/distributing-large-binaries - - /articles/removing-files-from-a-repository-s-history - - /articles/removing-files-from-a-repositorys-history - - /github/managing-large-files/removing-files-from-a-repositorys-history - - /github/managing-large-files/working-with-large-files/removing-files-from-a-repositorys-history - - /articles/conditions-for-large-files - - /github/managing-large-files/conditions-for-large-files - - /github/managing-large-files/working-with-large-files/conditions-for-large-files - - /articles/what-is-the-size-limit-for-a-repository - - /articles/what-is-my-disk-quota - - /github/managing-large-files/what-is-my-disk-quota - - /github/managing-large-files/working-with-large-files/what-is-my-disk-quota -versions: - fpt: '*' - ghes: '*' - ghec: '*' -shortTitle: Large files ---- - -## About size limits on {% data variables.product.product_name %} - -{% data variables.product.product_name %} tries to provide abundant storage for all Git repositories, although there are hard limits for file {% ifversion fpt or ghec %}and repository sizes{% else %} sizes and recommendations for repository sizes{% endif %}. {% ifversion fpt or ghec %}To ensure performance and reliability for our users, we actively monitor signals of overall repository health. Repository health is a function of various interacting factors, including size, commit frequency, contents, and structure.{% endif %} - -### File size limits - -{% data variables.product.product_name %} limits the size of files allowed in repositories. If you attempt to add or update a file that is larger than {% data variables.large_files.warning_size %}, you will receive a warning from Git. The changes will still successfully push to your repository, but you can consider removing the commit to minimize performance impact. For more information, see "[Removing files from a repository's history](#removing-files-from-a-repositorys-history)." - -{% note %} - -**Note:** If you add a file to a repository via a browser, the file can be no larger than {% data variables.large_files.max_github_browser_size %}. For more information, see "[AUTOTITLE](/repositories/working-with-files/managing-files/adding-a-file-to-a-repository)." - -{% endnote %} - -{% ifversion ghes %}By default, {% endif %}{% data variables.product.product_name %} blocks files larger than {% data variables.large_files.max_github_size %}. {% ifversion ghes %}However, a site administrator can configure a different limit for {% data variables.location.product_location %}. For more information, see "[AUTOTITLE](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise)."{% endif %} - -To track files beyond this limit, you must use {% data variables.large_files.product_name_long %} ({% data variables.large_files.product_name_short %}). For more information, see "[AUTOTITLE](/repositories/working-with-files/managing-large-files/about-git-large-file-storage)." - -If you need to distribute large files within your repository, you can create releases on {% data variables.location.product_location %} instead of tracking the files. For more information, see "[Distributing large binaries](#distributing-large-binaries)." - -Git is not designed to handle large SQL files. To share large databases with other developers, we recommend using a file sharing service. - -{% ifversion fpt or ghec %} - -### Repository size limits - -We recommend repositories remain small, ideally less than 1 GB, and less than 5 GB is strongly recommended. Smaller repositories are faster to clone and easier to work with and maintain. If your repository excessively impacts our infrastructure, you might receive an email from {% data variables.contact.github_support %} asking you to take corrective action. We try to be flexible, especially with large projects that have many collaborators, and will work with you to find a resolution whenever possible. You can prevent your repository from impacting our infrastructure by effectively managing your repository's size and overall health. You can find advice and a tool for repository analysis in the [`github/git-sizer`](https://github.com/github/git-sizer) repository. - -External dependencies can cause Git repositories to become very large. To avoid filling a repository with external dependencies, we recommend you use a package manager. Popular package managers for common languages include [Bundler](http://bundler.io/), [Node's Package Manager](http://npmjs.org/), and [Maven](https://maven.apache.org/). These package managers support using Git repositories directly, so you don't need pre-packaged sources. - -Git is not designed to serve as a backup tool. However, there are many solutions specifically designed for performing backups, such as [Arq](https://www.arqbackup.com/), [Carbonite](http://www.carbonite.com/), and [CrashPlan](https://www.crashplan.com/en-us/). -{% endif %} - -{% ifversion ghes %} - -### Repository size recommendations - -We recommend repositories remain small, ideally less than 1 GB, and less than 5 GB is strongly recommended. Smaller repositories are faster to clone and easier to work with and maintain. - -You can prevent your repository from impacting your infrastructure by effectively managing your repository's size and overall health. You can find advice and a tool for repository analysis in the [github/git-sizer](https://github.com/github/git-sizer) repository. -{% endif %} - -## Removing files from a repository's history - -{% warning %} - -**Warning**: These procedures will permanently remove files from the repository on your computer and {% data variables.location.product_location %}. If the file is important, make a local backup copy in a directory outside of the repository. - -{% endwarning %} - -### Removing a file added in the most recent unpushed commit - -If the file was added with your most recent commit, and you have not pushed to {% data variables.location.product_location %}, you can delete the file and amend the commit: - -{% data reusables.command_line.open_the_multi_os_terminal %} -{% data reusables.command_line.switching_directories_procedural %} -1. To remove the file, enter `git rm --cached`: - - ```shell - $ git rm --cached GIANT_FILE - # Stage our giant file for removal, but leave it on disk - ``` - -1. Commit this change using `--amend -CHEAD`: - - ```shell - $ git commit --amend -CHEAD - # Amend the previous commit with your change - # Simply making a new commit won't work, as you need - # to remove the file from the unpushed history as well - ``` - -1. Push your commits to {% data variables.location.product_location %}: - - ```shell - $ git push - # Push our rewritten, smaller commit - ``` - -### Removing a file that was added in an earlier commit - -If you added a file in an earlier commit, you need to remove it from the repository's history. To remove files from the repository's history, you can use the BFG Repo-Cleaner or the `git filter-repo` command. For more information see "[AUTOTITLE](/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository)." - -## Distributing large binaries - -If you need to distribute large files within your repository, you can create releases on {% data variables.location.product_location %}. Releases allow you to package software, release notes, and links to binary files, for other people to use. For more information, visit "[AUTOTITLE](/repositories/releasing-projects-on-github/about-releases)." - -{% ifversion fpt or ghec %} - -We don't limit the total size of the binary files in the release or the bandwidth used to deliver them. However, each individual file must be smaller than {% data variables.large_files.max_lfs_size %}. - -{% endif %} diff --git a/content/repositories/working-with-files/managing-large-files/about-storage-and-bandwidth-usage.md b/content/repositories/working-with-files/managing-large-files/about-storage-and-bandwidth-usage.md deleted file mode 100644 index 68564466f148..000000000000 --- a/content/repositories/working-with-files/managing-large-files/about-storage-and-bandwidth-usage.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: About storage and bandwidth usage -intro: '{% data reusables.large_files.free-storage-bandwidth-amount %}' -redirect_from: - - /articles/billing-plans-for-large-file-storage - - /articles/billing-plans-for-git-large-file-storage - - /articles/about-storage-and-bandwidth-usage - - /github/managing-large-files/about-storage-and-bandwidth-usage - - /github/managing-large-files/versioning-large-files/about-storage-and-bandwidth-usage -versions: - fpt: '*' - ghec: '*' -shortTitle: Storage & bandwidth ---- -{% data variables.large_files.product_name_short %} is available for every repository on {% data variables.product.product_name %}, whether or not your account or organization has a paid subscription. - -## Tracking storage and bandwidth use - -When you commit and push a change to a file tracked with {% data variables.large_files.product_name_short %}, a new version of the entire file is pushed and the total file size is counted against the repository owner's storage limit. When you download a file tracked with {% data variables.large_files.product_name_short %}, the total file size is counted against the repository owner's bandwidth limit. {% data variables.large_files.product_name_short %} uploads do not count against the bandwidth limit. - -For example: -- If you push a 500 MB file to {% data variables.large_files.product_name_short %}, you'll use 500 MB of your allotted storage and none of your bandwidth. If you make a 1 byte change and push the file again, you'll use another 500 MB of storage and no bandwidth, bringing your total usage for these two pushes to 1 GB of storage and zero bandwidth. -- If you download a 500 MB file that's tracked with LFS, you'll use 500 MB of the repository owner's allotted bandwidth. If a collaborator pushes a change to the file and you pull the new version to your local repository, you'll use another 500 MB of bandwidth, bringing the total usage for these two downloads to 1 GB of bandwidth. -- If {% data variables.product.prodname_actions %} downloads a 500 MB file that is tracked with LFS, it will use 500 MB of the repository owner's allotted bandwidth. - -{% ifversion fpt or ghec %} -If {% data variables.large_files.product_name_long %} ({% data variables.large_files.product_name_short %}) objects are included in [source code archives](/repositories/working-with-files/using-files/downloading-source-code-archives) for your repository, downloads of those archives will count towards bandwidth usage for the repository. For more information, see "[AUTOTITLE](/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/managing-git-lfs-objects-in-archives-of-your-repository)." -{% endif %} - -{% tip %} - -**Tips**: -- {% data reusables.large_files.owner_quota_only %} -- {% data reusables.large_files.does_not_carry %} - -{% endtip %} - -## Storage quota - -If you use more than {% data variables.large_files.initial_storage_quota %} of storage without purchasing a data pack, you can still clone repositories with large assets, but you will only retrieve the pointer files, and you will not be able to push new files back up. For more information about pointer files, see "[AUTOTITLE](/repositories/working-with-files/managing-large-files/about-git-large-file-storage#pointer-file-format)." - -## Bandwidth quota - -If you use more than {% data variables.large_files.initial_bandwidth_quota %} of bandwidth per month without purchasing a data pack, {% data variables.large_files.product_name_short %} support is disabled on your account until the next month. - -## Further reading - -- "[AUTOTITLE](/billing/managing-billing-for-git-large-file-storage/viewing-your-git-large-file-storage-usage)" -- "[AUTOTITLE](/billing/managing-billing-for-git-large-file-storage)" diff --git a/content/repositories/working-with-files/managing-large-files/collaboration-with-git-large-file-storage.md b/content/repositories/working-with-files/managing-large-files/collaboration-with-git-large-file-storage.md deleted file mode 100644 index 3c23f1933378..000000000000 --- a/content/repositories/working-with-files/managing-large-files/collaboration-with-git-large-file-storage.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: Collaboration with Git Large File Storage -intro: 'With {% data variables.large_files.product_name_short %} enabled, you''ll be able to fetch, modify, and push large files just as you would expect with any file that Git manages. However, a user that doesn''t have {% data variables.large_files.product_name_short %} will experience a different workflow.' -redirect_from: - - /articles/collaboration-with-large-file-storage - - /articles/collaboration-with-git-large-file-storage - - /github/managing-large-files/collaboration-with-git-large-file-storage - - /github/managing-large-files/versioning-large-files/collaboration-with-git-large-file-storage -versions: - fpt: '*' - ghes: '*' - ghec: '*' -shortTitle: Collaboration ---- -If collaborators on your repository don't have {% data variables.large_files.product_name_short %} installed, they won't have access to the original large file. If they attempt to clone your repository, they will only fetch the pointer files, and won't have access to any of the actual data. - -{% tip %} - -**Tip:** To help users without {% data variables.large_files.product_name_short %} enabled, we recommend you set guidelines for repository contributors that describe how to work with large files. For example, you may ask contributors not to modify large files, or to upload changes to a file sharing service like [Dropbox](http://www.dropbox.com/) or [Google Drive](https://drive.google.com). For more information, see "[AUTOTITLE](/communities/setting-up-your-project-for-healthy-contributions/setting-guidelines-for-repository-contributors)." - -{% endtip %} - -## Viewing large files in pull requests - -{% data variables.product.product_name %} does not render some {% data variables.large_files.product_name_short %} objects in pull requests. Only the pointer file is shown, with contents similar to the following: - -```text -+version https://git-lfs.github.com/spec/vi -+id sha256:7194bdd797bde471a6e29b4fa9c8c2278b3c4dadfc5cb2c36d7f4531dc6cb8f -+size 17330 -``` - -For more information about pointer files, see "[AUTOTITLE](/repositories/working-with-files/managing-large-files/about-git-large-file-storage#pointer-file-format)." - -To view changes made to large files, check out the pull request locally to review the diff. For more information, see "[AUTOTITLE](/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally)." - -{% ifversion fpt or ghec %} - -## Pushing large files to forks - -Pushing large files to forks of a repository count against the parent repository's bandwidth and storage quotas, rather than the quotas of the fork owner. - -You can push {% data variables.large_files.product_name_short %} objects to public forks if the repository network already has {% data variables.large_files.product_name_short %} objects or you have write access to the root of the repository network. - -{% endif %} - -## Further reading - -- "[AUTOTITLE](/repositories/creating-and-managing-repositories/duplicating-a-repository#mirroring-a-repository-that-contains-git-large-file-storage-objects)" diff --git a/content/repositories/working-with-files/managing-large-files/configuring-git-large-file-storage.md b/content/repositories/working-with-files/managing-large-files/configuring-git-large-file-storage.md deleted file mode 100644 index 4e31d1aaaa60..000000000000 --- a/content/repositories/working-with-files/managing-large-files/configuring-git-large-file-storage.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: Configuring Git Large File Storage -intro: 'Once [{% data variables.large_files.product_name_short %} is installed](/articles/installing-git-large-file-storage/), you need to associate it with a large file in your repository.' -redirect_from: - - /articles/configuring-large-file-storage - - /articles/configuring-git-large-file-storage - - /github/managing-large-files/configuring-git-large-file-storage - - /github/managing-large-files/versioning-large-files/configuring-git-large-file-storage -versions: - fpt: '*' - ghes: '*' - ghec: '*' -shortTitle: Configure Git LFS ---- -If there are existing files in your repository that you'd like to use {% data variables.product.product_name %} with, you need to first remove them from the repository and then add them to {% data variables.large_files.product_name_short %} locally. For more information, see "[AUTOTITLE](/repositories/working-with-files/managing-large-files/moving-a-file-in-your-repository-to-git-large-file-storage)." - -{% data reusables.large_files.resolving-upload-failures %} - -{% ifversion ghes %} - -{% tip %} - -**Note:** Before trying to push a large file to {% data variables.product.product_name %}, make sure that you've enabled {% data variables.large_files.product_name_short %} on your enterprise. For more information, see "[AUTOTITLE](/admin/user-management/managing-repositories-in-your-enterprise/configuring-git-large-file-storage-for-your-enterprise)." - -{% endtip %} - -{% endif %} - -{% data reusables.command_line.open_the_multi_os_terminal %} -1. Change your current working directory to an existing repository you'd like to use with {% data variables.large_files.product_name_short %}. -1. To associate a file type in your repository with {% data variables.large_files.product_name_short %}, enter `git {% data variables.large_files.command_name %} track` followed by the name of the file extension you want to automatically upload to {% data variables.large_files.product_name_short %}. - - For example, to associate a _.psd_ file, enter the following command: - - ```shell - $ git {% data variables.large_files.command_name %} track "*.psd" - > Tracking "*.psd" - ``` - - Every file type you want to associate with {% data variables.large_files.product_name_short %} will need to be added with `git {% data variables.large_files.command_name %} track`. This command amends your repository's _.gitattributes_ file and associates large files with {% data variables.large_files.product_name_short %}. - - {% note %} - - **Note:** We strongly suggest that you commit your local _.gitattributes_ file into your repository. - - - Relying on a global _.gitattributes_ file associated with {% data variables.large_files.product_name_short %} may cause conflicts when contributing to other Git projects. - - Including the _.gitattributes_ file in the repository allows people creating forks or fresh clones to more easily collaborate using {% data variables.large_files.product_name_short %}. - - Including the _.gitattributes_ file in the repository allows {% data variables.large_files.product_name_short %} objects to optionally be included in ZIP file and tarball archives. - - {% endnote %} - -1. Add a file to the repository matching the extension you've associated: - - ```shell - git add path/to/file.psd - ``` - -1. Commit the file and push it to {% data variables.product.product_name %}: - - ```shell - git commit -m "add file.psd" - git push - ``` - - You should see some diagnostic information about your file upload: - - ```shell - > Sending file.psd - > 44.74 MB / 81.04 MB 55.21 % 14s - > 64.74 MB / 81.04 MB 79.21 % 3s - ``` - -## Further reading - -- "[AUTOTITLE](/repositories/working-with-files/managing-large-files/collaboration-with-git-large-file-storage)"{% ifversion fpt or ghec %} -- "[AUTOTITLE](/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/managing-git-lfs-objects-in-archives-of-your-repository)"{% endif %} diff --git a/content/repositories/working-with-files/managing-large-files/index.md b/content/repositories/working-with-files/managing-large-files/index.md deleted file mode 100644 index 478de371ece8..000000000000 --- a/content/repositories/working-with-files/managing-large-files/index.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: Managing large files -intro: You can manage large files with Git Large File Storage. -redirect_from: - - /categories/managing-large-files - - /github/managing-large-files - - /articles/versioning-large-files - - /github/managing-large-files/versioning-large-files - - /articles/working-with-large-files - - /github/managing-large-files/working-with-large-files -versions: - fpt: '*' - ghes: '*' - ghec: '*' -children: - - /about-large-files-on-github - - /about-git-large-file-storage - - /installing-git-large-file-storage - - /configuring-git-large-file-storage - - /about-storage-and-bandwidth-usage - - /collaboration-with-git-large-file-storage - - /moving-a-file-in-your-repository-to-git-large-file-storage - - /removing-files-from-git-large-file-storage - - /resolving-git-large-file-storage-upload-failures ---- - diff --git a/content/repositories/working-with-files/managing-large-files/installing-git-large-file-storage.md b/content/repositories/working-with-files/managing-large-files/installing-git-large-file-storage.md deleted file mode 100644 index 842d1ea8af7b..000000000000 --- a/content/repositories/working-with-files/managing-large-files/installing-git-large-file-storage.md +++ /dev/null @@ -1,129 +0,0 @@ ---- -title: Installing Git Large File Storage -intro: 'In order to use {% data variables.large_files.product_name_short %}, you''ll need to download and install a new program that''s separate from Git.' -redirect_from: - - /articles/installing-large-file-storage - - /articles/installing-git-large-file-storage - - /github/managing-large-files/installing-git-large-file-storage - - /github/managing-large-files/versioning-large-files/installing-git-large-file-storage -versions: - fpt: '*' - ghes: '*' - ghec: '*' -shortTitle: Install Git LFS ---- -{% mac %} - -1. Navigate to [git-lfs.com](https://git-lfs.com) and click **Download**. Alternatively, you can install {% data variables.large_files.product_name_short %} using a package manager: - - To use [Homebrew](https://brew.sh/), run `brew install git-lfs`. - - To use [MacPorts](https://www.macports.org/), run `port install git-lfs`. - - If you install {% data variables.large_files.product_name_short %} with Homebrew or MacPorts, skip to step six. - -1. On your computer, locate and unzip the downloaded file. -{% data reusables.command_line.open_the_multi_os_terminal %} -1. Change the current working directory into the folder you downloaded and unzipped. - - ```shell - cd ~/Downloads/git-lfs-1.X.X - ``` - - {% note %} - - **Note:** The file path you use after `cd` depends on your operating system, Git LFS version you downloaded, and where you saved the {% data variables.large_files.product_name_short %} download. - - {% endnote %} -1. To install the file, run this command: - - ```shell - $ ./install.sh - > {% data variables.large_files.product_name_short %} initialized. - ``` - - {% note %} - - **Note:** You may have to use `sudo ./install.sh` to install the file. - - {% endnote %} -1. Verify that the installation was successful: - - ```shell - $ git {% data variables.large_files.command_name %} install - > {% data variables.large_files.product_name_short %} initialized. - ``` - -1. If you don't see a message indicating that `git {% data variables.large_files.command_name %} install` was successful, please contact {% data variables.contact.contact_support %}. Be sure to include the name of your operating system. - -{% endmac %} - -{% windows %} - -1. Navigate to [git-lfs.com](https://git-lfs.com) and click **Download**. - - {% tip %} - - **Tip:** For more information about alternative ways to install {% data variables.large_files.product_name_short %} for Windows, see this [Getting started guide](https://github.com/github/git-lfs#getting-started). - - {% endtip %} -1. On your computer, locate the downloaded file. -1. Double click on the file called _git-lfs-windows-1.X.X.exe_, where 1.X.X is replaced with the Git LFS version you downloaded. When you open this file Windows will run a setup wizard to install {% data variables.large_files.product_name_short %}. -{% data reusables.command_line.open_the_multi_os_terminal %} As the setup wizard may have modified your system `PATH`, opening a new session will ensure Git can locate Git LFS. -1. Verify that the installation was successful: - - ```shell - $ git {% data variables.large_files.command_name %} install - > {% data variables.large_files.product_name_short %} initialized. - ``` - -1. If you don't see a message indicating that `git {% data variables.large_files.command_name %} install` was successful, please contact {% data variables.contact.contact_support %}. Be sure to include the name of your operating system. - -{% endwindows %} - -{% linux %} - -1. Navigate to [git-lfs.com](https://git-lfs.com) and click **Download**. - - {% tip %} - - **Tip:** For more information about alternative ways to install {% data variables.large_files.product_name_short %} for Linux, see this [Getting started guide](https://github.com/github/git-lfs#getting-started). - - {% endtip %} -1. On your computer, locate and unzip the downloaded file. -{% data reusables.command_line.open_the_multi_os_terminal %} -1. Change the current working directory into the folder you downloaded and unzipped. - - ```shell - cd ~/Downloads/git-lfs-1.X.X - ``` - - {% note %} - - **Note:** The file path you use after `cd` depends on your operating system, Git LFS version you downloaded, and where you saved the {% data variables.large_files.product_name_short %} download. - - {% endnote %} -1. To install the file, run this command: - - ```shell - $ ./install.sh - > {% data variables.large_files.product_name_short %} initialized. - ``` - - {% note %} - - **Note:** You may have to use `sudo ./install.sh` to install the file. - - {% endnote %} -1. Verify that the installation was successful: - - ```shell - $ git {% data variables.large_files.command_name %} install - > {% data variables.large_files.product_name_short %} initialized. - ``` - -1. If you don't see a message indicating that `git {% data variables.large_files.command_name %} install` was successful, please contact {% data variables.contact.contact_support %}. Be sure to include the name of your operating system. - -{% endlinux %} - -## Further reading - -- "[AUTOTITLE](/repositories/working-with-files/managing-large-files/configuring-git-large-file-storage)" diff --git a/content/repositories/working-with-files/managing-large-files/moving-a-file-in-your-repository-to-git-large-file-storage.md b/content/repositories/working-with-files/managing-large-files/moving-a-file-in-your-repository-to-git-large-file-storage.md deleted file mode 100644 index 9ecb90b12e82..000000000000 --- a/content/repositories/working-with-files/managing-large-files/moving-a-file-in-your-repository-to-git-large-file-storage.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: Moving a file in your repository to Git Large File Storage -intro: 'If you''ve set up {% data variables.large_files.product_name_short %}, and you have an existing file in your repository that needs to be tracked in {% data variables.large_files.product_name_short %}, you need to first remove it from your repository.' -redirect_from: - - /articles/moving-a-file-in-your-repository-to-git-large-file-storage - - /github/managing-large-files/moving-a-file-in-your-repository-to-git-large-file-storage - - /github/managing-large-files/versioning-large-files/moving-a-file-in-your-repository-to-git-large-file-storage -versions: - fpt: '*' - ghes: '*' - ghec: '*' -shortTitle: Move a file to Git LFS ---- -After installing {% data variables.large_files.product_name_short %} and configuring {% data variables.large_files.product_name_short %} tracking, you can move files from Git's regular tracking to {% data variables.large_files.product_name_short %}. For more information, see "[AUTOTITLE](/repositories/working-with-files/managing-large-files/installing-git-large-file-storage)" and "[AUTOTITLE](/repositories/working-with-files/managing-large-files/configuring-git-large-file-storage)." - -{% data reusables.large_files.resolving-upload-failures %} - -{% tip %} - -**Tip:** If you get an error that "this exceeds {% data variables.large_files.product_name_short %}'s file size limit of {% data variables.large_files.max_github_size %}" when you try to push files to Git, you can use `git lfs migrate` instead of `filter-repo` or the BFG Repo Cleaner, to move the large file to {% data variables.large_files.product_name_long %}. For more information about the `git lfs migrate` command, see the [Git LFS 2.2.0](https://github.com/blog/2384-git-lfs-2-2-0-released) release announcement. - -{% endtip %} - -1. Remove the file from the repository's Git history using either the `filter-repo` command or BFG Repo-Cleaner. For detailed information on using these, see "[AUTOTITLE](/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository)." -1. Configure tracking for your file and push it to {% data variables.large_files.product_name_short %}. For more information on this procedure, see "[AUTOTITLE](/repositories/working-with-files/managing-large-files/configuring-git-large-file-storage)." - -## Further reading - -- "[AUTOTITLE](/repositories/working-with-files/managing-large-files/about-git-large-file-storage)" -- "[AUTOTITLE](/repositories/working-with-files/managing-large-files/collaboration-with-git-large-file-storage)" -- "[AUTOTITLE](/repositories/working-with-files/managing-large-files/installing-git-large-file-storage)" diff --git a/content/repositories/working-with-files/managing-large-files/removing-files-from-git-large-file-storage.md b/content/repositories/working-with-files/managing-large-files/removing-files-from-git-large-file-storage.md deleted file mode 100644 index 6995353f07c5..000000000000 --- a/content/repositories/working-with-files/managing-large-files/removing-files-from-git-large-file-storage.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: Removing files from Git Large File Storage -intro: 'If you''ve set up {% data variables.large_files.product_name_short %} for your repository, you can remove all files or a subset of files from {% data variables.large_files.product_name_short %}.' -redirect_from: - - /articles/removing-files-from-git-large-file-storage - - /github/managing-large-files/removing-files-from-git-large-file-storage - - /github/managing-large-files/versioning-large-files/removing-files-from-git-large-file-storage -versions: - fpt: '*' - ghes: '*' - ghec: '*' -shortTitle: Remove files ---- -## Removing a single file - -1. Remove the file from the repository's Git history using either the `filter-repo` command or BFG Repo-Cleaner. For detailed information on using these, see "[AUTOTITLE](/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository)." -1. Navigate to your _.gitattributes_ file. - - {% note %} - - **Note:** Your _.gitattributes_ file is generally saved within your local repository. In some cases, you may have created a global _.gitattributes_ file that contains all of your {% data variables.large_files.product_name_short %} associations. - - {% endnote %} -1. Find and remove the associated {% data variables.large_files.product_name_short %} tracking rule within the _.gitattributes_ file. -1. Save and exit the _.gitattributes_ file. - -## Removing all files within a {% data variables.large_files.product_name_short %} repository - -1. Remove the files from the repository's Git history using either the `filter-repo` command or BFG Repo-Cleaner. For detailed information on using these, see "[AUTOTITLE](/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository)." -1. Optionally, to uninstall {% data variables.large_files.product_name_short %} in the repository, run: - - ```shell - git lfs uninstall - ``` - - For {% data variables.large_files.product_name_short %} versions below 1.1.0, run: - - ```shell - git lfs uninit - ``` - -## {% data variables.large_files.product_name_short %} objects in your repository - -After you remove files from {% data variables.large_files.product_name_short %}, the {% data variables.large_files.product_name_short %} objects still exist on the remote storage{% ifversion fpt or ghec %} and will continue to count toward your {% data variables.large_files.product_name_short %} storage quota{% endif %}. - -To remove {% data variables.large_files.product_name_short %} objects from a repository, {% ifversion fpt or ghec %}delete and recreate the repository. When you delete a repository, any associated issues, stars, and forks are also deleted. For more information, see "[AUTOTITLE](/repositories/creating-and-managing-repositories/deleting-a-repository)." If you need to purge a removed object and you are unable to delete the repository, please [contact support](/support) for help.{% else %}contact your {% data variables.product.prodname_enterprise %} administrator to archive the objects. Archived objects are purged after three months.{% endif %} - -{% note %} - -**Note:** If you removed a single file and have other {% data variables.large_files.product_name_short %} objects that you'd like to keep in your repository, after deleting and recreating your repository, reconfigure your {% data variables.large_files.product_name_short %}-associated files. For more information, see "[Removing a single file](#removing-a-single-file)" and "[AUTOTITLE](/repositories/working-with-files/managing-large-files/configuring-git-large-file-storage)." - -{% endnote %} - -## Further reading - -- "[AUTOTITLE](/repositories/working-with-files/managing-large-files/about-git-large-file-storage)" -- "[AUTOTITLE](/repositories/working-with-files/managing-large-files/collaboration-with-git-large-file-storage)" -- "[AUTOTITLE](/repositories/working-with-files/managing-large-files/installing-git-large-file-storage)" diff --git a/content/repositories/working-with-files/managing-large-files/resolving-git-large-file-storage-upload-failures.md b/content/repositories/working-with-files/managing-large-files/resolving-git-large-file-storage-upload-failures.md deleted file mode 100644 index 6194411f6f5c..000000000000 --- a/content/repositories/working-with-files/managing-large-files/resolving-git-large-file-storage-upload-failures.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Resolving Git Large File Storage upload failures -intro: 'If your {% data variables.large_files.product_name_short %} files didn''t upload properly, you can take several steps to troubleshoot the upload error.' -redirect_from: - - /articles/resolving-git-large-file-storage-upload-failures - - /github/managing-large-files/resolving-git-large-file-storage-upload-failures - - /github/managing-large-files/versioning-large-files/resolving-git-large-file-storage-upload-failures -versions: - fpt: '*' - ghes: '*' - ghec: '*' -shortTitle: Resolve upload failures ---- -The {% data variables.large_files.product_name_short %} integrity check ensures that all referenced {% data variables.large_files.product_name_short %} files in a push have been uploaded properly. If the check detects referenced files that have not been uploaded, you will receive an error message and your push will be blocked. - -To resolve the error message, you must reinstall your local {% data variables.large_files.product_name_short %} client to ensure that the referenced {% data variables.large_files.product_name_short %} files can be properly uploaded in the future. - -1. Open Terminal. -1. Reinstall {% data variables.large_files.product_name_short %}. - - ```shell - git lfs install - ``` - -1. Push all referenced {% data variables.large_files.product_name_short %} files. - - ```shell - git lfs push --all origin - ``` diff --git a/content/repositories/working-with-files/using-files/downloading-source-code-archives.md b/content/repositories/working-with-files/using-files/downloading-source-code-archives.md deleted file mode 100644 index 29c2e8de975c..000000000000 --- a/content/repositories/working-with-files/using-files/downloading-source-code-archives.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: Downloading source code archives -intro: 'You can download a snapshot of the code in your repository.' -versions: - fpt: '*' - ghes: '*' - ghec: '*' -topics: - - Repositories -shortTitle: Source code archives ---- -## Overview of source code archives - -You can download a snapshot of any branch, tag, or specific commit from {% data variables.location.product_location %}. These snapshots are generated by the [`git archive` command](https://git-scm.com/docs/git-archive) in one of two formats: tarball or zipball. Snapshots don't contain the entire repository history. If you want the entire history, you can clone the repository. For more information, see "[AUTOTITLE](/repositories/creating-and-managing-repositories/cloning-a-repository)." - -## Downloading source code archives - -You can download the source code archives in three ways. - -### Downloading source code archives from the repository view - -{% data reusables.repositories.navigate-to-repo %} -{% data reusables.repositories.click-code-dropdown %} -{% data reusables.repositories.download-zip %} - -### Downloading source code archives from a release - -{% data reusables.repositories.navigate-to-repo %} -{% data reusables.repositories.releases %} -1. Scroll down to the "Assets" section of the release. -1. To download the source code, click {% octicon "file-zip" aria-hidden="true" %} **Source code (zip)** or {% octicon "file-zip" aria-hidden="true" %} **Source code (tar.gz)**. - -### Downloading source code archives from a tag - -{% data reusables.repositories.navigate-to-repo %} -{% data reusables.repositories.releases %} -1. At the top of the Releases page, click **Tags**. -1. To download the source code, click {% octicon "file-zip" aria-label="The ZIP icon" %} **zip** or {% octicon "file-zip" aria-label="The ZIP icon" %} **tar.gz**. - - ![Screenshot of the "Tags" page of a repository. The zip and tar.gz options are outlined in dark orange.](/assets/images/help/repository/tags-download-zip-targz.png) - -## Source code archive URLs - -Source code archives are available at specific URLs for each repository. For example, consider the repository `github/codeql`. There are different URLs for downloading a branch, a tag, or a specific commit ID. - -| Type of archive | Example | URL | -|-----------------|---------|---------| -| Branch | `main` | [https://github.com/github/codeql/archive/refs/**heads/main**.tar.gz](https://github.com/github/codeql/archive/refs/heads/main.tar.gz) | -| Tag | `codeql-cli/v2.12.0` | [https://github.com/github/codeql/archive/refs/**tags/codeql-cli/v2.12.0**.zip](https://github.com/github/codeql/archive/refs/tags/codeql-cli/v2.12.0.zip) | -| Commit | `aef66c4` | [https://github.com/github/codeql/archive/**aef66c462abe817e33aad91d97aa782a1e2ad2c7**.zip](https://github.com/github/codeql/archive/aef66c462abe817e33aad91d97aa782a1e2ad2c7.zip) | - -{% note %} - -**Note**: You can use either `.zip` or `.tar.gz` in the URLs above to request a zipball or tarball respectively. - -{% endnote %} - -## Stability of source code archives - -Source code archives are generated on request, cached for a while, and then deleted. If the same archive is requested again in the future, it'll be regenerated. It's important to understand what guarantees {% data variables.product.company_short %} makes about source code archives. - -- An archive of a commit ID will always have the same file contents whenever it's requested, assuming the commit ID is still in the repository and the repository's name has not changed. -- Because branches and tags can move to different commit IDs, future downloads of an archive may have different contents than previously downloaded archives of the same branch or tag. Assuming the branch or tag still points at the same commit ID, it will have the same file contents. -- The exact compression settings used to generate a zipball or tarball may change over time. The extracted contents won't change if the branch or tag doesn't change, but the outer compressed archive may have a different byte layout. {% data variables.product.company_short %} will give at least six months' notice before changing compression settings. -- The name of the repository is part of the directory structure inside the archive. Therefore, if the repository name changes, the root directory name will change as well. - -If you rely on stability of source code archives for reproducibility (ensuring you always get identical files inside the archive), we recommend using the [archives REST API](/rest/repos/contents#download-a-repository-archive-tar) with a commit ID for `:ref`. Using the commit ID ensures you'll always get the same file contents inside the archive and you’ll be immune to repositories rewriting tags or moving branch heads. - -If you rely on stability of archives for security (for example: to ensure you don't attempt to unzip a maliciously-crafted file), we recommend using releases instead of using source downloads. For more information, see "[AUTOTITLE](/repositories/releasing-projects-on-github/about-releases)." - -You can use something like [this third-party {% data variables.product.company_short %} action](https://github.com/softprops/action-gh-release) to create and push these files as part of your release process. The [Release Assets REST API](/rest/releases/assets#get-a-release-asset) can later be used to retrieve them. diff --git a/content/repositories/working-with-files/using-files/getting-permanent-links-to-files.md b/content/repositories/working-with-files/using-files/getting-permanent-links-to-files.md deleted file mode 100644 index 4412255f597d..000000000000 --- a/content/repositories/working-with-files/using-files/getting-permanent-links-to-files.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: Getting permanent links to files -intro: 'When viewing a file on {% data variables.location.product_location %}, you can press the "y" key to update the URL to a permalink to the exact version of the file you see.' -redirect_from: - - /articles/getting-a-permanent-link-to-a-file - - /articles/how-do-i-get-a-permanent-link-from-file-view-to-permanent-blob-url - - /articles/getting-permanent-links-to-files - - /github/managing-files-in-a-repository/getting-permanent-links-to-files - - /github/managing-files-in-a-repository/managing-files-on-github/getting-permanent-links-to-files -versions: - fpt: '*' - ghes: '*' - ghec: '*' -topics: - - Repositories -shortTitle: Permanent links to files ---- -{% tip %} - -**Tip**: Press "?" on any page in {% data variables.product.product_name %} to see all available keyboard shortcuts. - -{% endtip %} - -## File views show the latest version on a branch - -When viewing a file on {% data variables.location.product_location %}, you usually see the version at the current head of a branch. For example: - -- [https://github.com/github/codeql/blob/**main**/README.md](https://github.com/github/codeql/blob/main/README.md) - -refers to GitHub's `codeql` repository, and shows the `main` branch's current version of the `README.md` file. - -The version of a file at the head of branch can change as new commits are made, so if you were to copy the normal URL, the file contents might not be the same when someone looks at it later. - -## Press Y to permalink to a file in a specific commit - -For a permanent link to the specific version of a file that you see, instead of using a branch name in the URL (i.e. the `main` part in the example above), put a commit ID. This will permanently link to the exact version of the file in that commit. For example: - -- [https://github.com/github/codeql/blob/**b212af08a6cffbb434f3c8a2795a579e092792fd**/README.md](https://github.com/github/codeql/blob/b212af08a6cffbb434f3c8a2795a579e092792fd/README.md) - -replaces `main` with a specific commit ID and the file content will not change. - -Looking up the commit SHA by hand is inconvenient, however, so as a shortcut you can type y to automatically update the URL to the permalink version. Then you can copy the URL knowing that anyone you share it with will see exactly what you saw. - -{% tip %} - -**Tip**: You can put any identifier that can be resolved to a commit in the URL, including branch names, specific commit SHAs, or tags! - -{% endtip %} - -## Creating a permanent link to a code snippet - -You can create a permanent link to a specific line or range of lines of code in a specific version of a file or pull request. For more information, see "[AUTOTITLE](/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet)." - -## Further reading - -- "[AUTOTITLE](/repositories/archiving-a-github-repository)" diff --git a/content/repositories/working-with-files/using-files/index.md b/content/repositories/working-with-files/using-files/index.md deleted file mode 100644 index 25a13d198a9b..000000000000 --- a/content/repositories/working-with-files/using-files/index.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: Using files -intro: You can navigate and track changes in the code in your files. -versions: - fpt: '*' - ghes: '*' - ghec: '*' -children: - - /navigating-code-on-github - - /viewing-a-file - - /getting-permanent-links-to-files - - /downloading-source-code-archives - - /working-with-non-code-files ---- - diff --git a/content/repositories/working-with-files/using-files/navigating-code-on-github.md b/content/repositories/working-with-files/using-files/navigating-code-on-github.md deleted file mode 100644 index 8dd2eb3e399a..000000000000 --- a/content/repositories/working-with-files/using-files/navigating-code-on-github.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Navigating code on GitHub -intro: 'You can understand the relationships within and across repositories by navigating code directly in {% data variables.product.product_name %}.' -redirect_from: - - /articles/navigating-code-on-github - - /github/managing-files-in-a-repository/navigating-code-on-github - - /github/managing-files-in-a-repository/managing-files-on-github/navigating-code-on-github -versions: - fpt: '*' - ghec: '*' -topics: - - Repositories ---- - - -## About navigating code on {% data variables.product.prodname_dotcom %} - -Code navigation helps you to read, navigate, and understand code by showing and linking definitions of a named entity corresponding to a reference to that entity, as well as references corresponding to an entity's definition. - -![Screenshot showing a code file with a function called "request" highlighted and a pop-up window with information about the function underneath. The pop-up has two tabs: "Definition" and "Reference".](/assets/images/help/repository/code-navigation-popover.png) - -Code navigation uses the open source [`tree-sitter`](https://github.com/tree-sitter/tree-sitter) library. The following languages and navigation strategies are supported. - -{% rowheaders %} - -| Language | Search-based code navigation | Precise code navigation | -|------------------|:--------------------------------------------:|:--------------------------------------------:| -| Bash | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| C | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| C# | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| C++ | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| CodeQL | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| Elixir | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| Go | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| JSX | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| Java | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| JavaScript | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| Lua | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| PHP | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| Protocol Buffers | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| Python | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | -| Ruby | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| Rust | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| Scala | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| Starlark | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| Swift | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | -| TypeScript | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | - -{% endrowheaders %} - -You do not need to configure anything in your repository to enable code navigation. We will automatically extract search-based and precise code navigation information for these supported languages in all repositories and you can switch between the two supported code navigation approaches if your programming language is supported by both. - -{% data variables.product.prodname_dotcom %} has developed two code navigation approaches based on the open source [`tree-sitter`](https://github.com/tree-sitter/tree-sitter) and [`stack-graphs`](https://github.com/github/stack-graphs) library: -- Search-based - searches all definitions and references across a repository to find entities with a given name -- Precise - resolves definitions and references based on the set of classes, functions, and imported definitions at a given point in your code - -To learn more about these approaches, see "[Precise and search-based navigation](#precise-and-search-based-navigation)." - -Future releases will add _precise code navigation_ for more languages, which is a code navigation approach that can give more accurate results. - -{% ifversion code-view-ui %}You can use keyboard shortcuts to navigate within a code file. For more information, see "[AUTOTITLE](/get-started/accessibility/keyboard-shortcuts#navigating-within-code-files)."{% endif %} - -{% ifversion code-search-upgrade %} - -## Using the symbols pane - -You can now quickly view and navigate between symbols such as functions or classes in your code with the symbols pane. You can search for a symbol in a single file, in all files in a repository, or even in all public repositories on {% data variables.product.prodname_dotcom %}. - -Symbol search is a feature of code search. For more information, see "[AUTOTITLE](/search-github/github-code-search/understanding-github-code-search-syntax#symbol-qualifier)." - -1. Select a repository, then navigate to a file containing symbols. -1. To bring up the symbols pane, above the file content, click {% octicon "code-square" aria-label="The code square icon" %}. - - Alternatively, you can open the symbols pane by clicking an eligible symbol in your file. Clickable symbols are highlighted in yellow when you hover over them. - -1. Click the symbol you would like to find from the symbols pane or within the file itself. - - - To search for a symbol in the repository as a whole, in the symbols pane, click **Search for this symbol in this repository**. To search for a symbol in all repositories on {% data variables.product.prodname_dotcom %}, click **all repositories**. - -1. To navigate between references to a symbol, click {% octicon "chevron-down" aria-label="The downwards-facing chevron icon" %} or {% octicon "chevron-up" aria-label="The upwards-facing chevron icon" %}. -1. To navigate to a specific reference to a symbol, click a result of the symbol search under {% octicon "chevron-down" aria-label="The downwards-facing chevron icon" %} **In this file**. -1. To exit the search for a specific symbol, click {% octicon "arrow-left" aria-label="The left arrow icon" %} **All Symbols**. -{% endif %} - -## Jumping to the definition of a function or method - -You can jump to a function or method's definition within the same repository by clicking the function or method call in a file. - -![Screenshot of the function window. A section, titled "Definition," is outlined in dark orange.](/assets/images/help/repository/jump-to-definition-tab.png) - -## Finding all references of a function or method - -You can find all references for a function or method within the same repository by clicking the function or method call in a file. - -![Screenshot of the function window. A section, titled "3 References," is outlined in dark orange.](/assets/images/help/repository/find-all-references-tab.png) - -## Precise and search-based navigation - -Certain languages supported by {% data variables.product.prodname_dotcom %} have access to _precise code navigation_, which uses an algorithm (based on the open source [`stack-graphs`](https://github.com/github/stack-graphs) library) that resolves definitions and references based on the set of classes, functions, and imported definitions that are visible at any given point in your code. Other languages use _search-based code navigation_, which searches all definitions and references across a repository to find entities with a given name. Both strategies are effective at finding results and both make sure to avoid inappropriate results such as comments, but precise code navigation can give more accurate results, especially when a repository contains multiple methods or functions with the same name. - -If you don't see the results you expect from a precise code navigation query, you can click on the "search-based" link in the displayed popover to perform search-based navigation. - -![Screenshot of the function window. Two links, labeled, "Search for this symbol in this repository" and "all repositories," are outlined in dark orange.](/assets/images/help/repository/search-based-code-navigation-link.png) - -If your precise results appear inaccurate, you can file a support request. - -## Cross-repository precise code navigation - -Cross-repo code navigation is available for languages that are supported by precise code navigation and the dependency graph. For more information, see "[AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph)." With cross-repo code navigation, you can jump to the definition of functions or variables defined in dependencies imported by your project if that dependency is a repository hosted by {% data variables.product.prodname_dotcom %}. Cross-repo code navigation does not support find-all-references requests at this time. - -![Screenshot of a code file on {% data variables.product.prodname_dotcom %}. On the line "import o.s.", the module name "o.s." is highlighted, and a "Definitions" modal shows a result tagged with "cross-repo result".](/assets/images/help/repository/cross-repository-code-navigation.png) - -## Troubleshooting code navigation - -If code navigation is enabled for you but you don't see links to the definitions of functions and methods: -- Code navigation only works for active branches. Push to the branch and try again. -- Code navigation only works for repositories with fewer than 100,000 files. - -## Further reading - -- "[AUTOTITLE]{% ifversion code-search-upgrade %}(/search-github/github-code-search/about-github-code-search){% else %}(/search-github/searching-on-github/searching-code){% endif %}" diff --git a/content/repositories/working-with-files/using-files/viewing-a-file.md b/content/repositories/working-with-files/using-files/viewing-a-file.md deleted file mode 100644 index 25ca00913d89..000000000000 --- a/content/repositories/working-with-files/using-files/viewing-a-file.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: Viewing a file -intro: You can view raw file content or trace changes to lines in a file and discover how parts of the file evolved over time. -redirect_from: - - /articles/using-git-blame-to-trace-changes-in-a-file - - /articles/tracing-changes-in-a-file - - /articles/tracking-changes-in-a-file - - /github/managing-files-in-a-repository/tracking-changes-in-a-file - - /github/managing-files-in-a-repository/managing-files-on-github/tracking-changes-in-a-file - - /repositories/working-with-files/using-files/tracking-changes-in-a-file -versions: - fpt: '*' - ghes: '*' - ghec: '*' -topics: - - Repositories -shortTitle: View files and track file changes ---- -## Viewing or copying the raw file content - -With the raw view, you can view or copy the raw content of a file without any styling. - -{% data reusables.repositories.navigate-to-repo %} -1. Click the file that you want to view. -1. In the upper-right corner of the file view, click **Raw**. -{% ifversion code-view-ui %} - - ![Screenshot of a file. In the header, a button, labeled "Raw," outlined in dark orange.](/assets/images/help/repository/raw-file-button.png) -{% else %} - - ![Screenshot of a file. In the header, a button, labeled "Raw," outlined in dark orange.](/assets/images/enterprise/repository/raw-file-button.png) -{% endif %} -1. Optionally, to copy the raw file content, in the upper-right corner of the file view, click **{% octicon "copy" aria-label="Copy raw content" %}**. {% ifversion code-view-ui %} To download the raw file, click **{% octicon "download" aria-label="Download raw file" %}**.{% endif %} - -## Viewing the line-by-line revision history for a file - -Within the blame view, you can view the line-by-line revision history for an entire file. - -{% tip %} - -**Tip:** On the command line, you can also use `git blame` to view the revision history of lines within a file. For more information, see [Git's `git blame` documentation](https://git-scm.com/docs/git-blame). - -{% endtip %} - -{% data reusables.repositories.navigate-to-repo %} -1. Click to open the file whose line history you want to view. -{% ifversion code-view-ui %} -1. Above the file content, click **Blame**. This view gives you a line-by-line revision history, with the code in a file separated by commit. Each commit lists the author, commit description, and commit date. -1. To see versions of a file before a particular commit, click {% octicon "versions" aria-label="View blame prior to this change" %}. Alternatively, to see more detail about a particular commit, click the commit message. - - ![Screenshot of a commit in the blame view. The commit message and versions icon are outlined in dark orange.](/assets/images/help/repository/code-view-blame-commit-options.png) - -1. To return to the raw code view, above the file content, click **Code**. - - If you are viewing a Markdown file, above the file content, you can also click **Preview** to return to the view with Markdown formatting applied. -{% else %} -1. In the upper-right corner of the file view, click **Blame** to open the blame view. - - ![Screenshot showing the header for a file. The "Blame" button is outlined in dark orange.](/assets/images/enterprise/repository/blame-button.png) -1. To see earlier revisions of a specific line, or reblame, click {% octicon "versions" aria-label="View blame prior to this change" %} until you've found the changes you're interested in viewing. - - ![Screenshot of the "Blame" view of a file. To the right of a commit message, the versions icon is outlined in dark orange.](/assets/images/enterprise/repository/git-blame.png) -{% endif %} - -## Ignore commits in the blame view - -All revisions specified in the `.git-blame-ignore-revs` file, which must be in the root directory of your repository, are hidden from the blame view using Git's `git blame --ignore-revs-file` configuration setting. For more information, see [`git blame --ignore-revs-file`](https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt) in the Git documentation. - -1. In the root directory of your repository, create a file named `.git-blame-ignore-revs`. -1. Add the commit hashes you want to exclude from the blame view to that file. We recommend the file to be structured as follows, including comments: - - ```shell - # .git-blame-ignore-revs - # Removed semi-colons from the entire codebase - a8940f7fbddf7fad9d7d50014d4e8d46baf30592 - # Converted all JavaScript to TypeScript - 69d029cec8337c616552756310748c4a507bd75a - ``` - -1. Commit and push the changes. - -Now when you visit the blame view, the listed revisions will not be included in the blame. You'll see an **Ignoring revisions in .git-blame-ignore-revs** banner indicating that some commits may be hidden: - - - -{% ifversion fpt or ghec %} -![Screenshot of the blame view for the "ipc-main-internal.ts" file. A blue banner states that the information is "Ignoring revisions in .git-blame-ignore-revs." The link to the .git-blame-ignore-revs file is outlined in dark orange.](/assets/images/help/repository/blame-ignore-revs-file.png) -{% else %} -![Screenshot of the blame view for the "ipc-main-internal.ts" file. A blue banner states that the information is "Ignoring revisions in .git-blame-ignore-revs." The link to the .git-blame-ignore-revs file is outlined in dark orange.](/assets/images/enterprise/repository/blame-ignore-revs-file.png) -{% endif %} - -This can be useful when a few commits make extensive changes to your code. You can use the file when running `git blame` locally as well: - -```shell -git blame --ignore-revs-file .git-blame-ignore-revs -``` - -You can also configure your local git so it always ignores the revs in that file: - -```shell -git config blame.ignoreRevsFile .git-blame-ignore-revs -``` - -## Bypassing `.git-blame-ignore-revs` in the blame view - -If the blame view for a file shows **Ignoring revisions in .git-blame-ignore-revs**, you can still bypass `.git-blame-ignore-revs` and see the normal blame view. In the URL, append a `~` to the SHA and the **Ignoring revisions in .git-blame-ignore-revs** banner will disappear. diff --git a/content/repositories/working-with-files/using-files/working-with-non-code-files.md b/content/repositories/working-with-files/using-files/working-with-non-code-files.md deleted file mode 100644 index fc2f8411034c..000000000000 --- a/content/repositories/working-with-files/using-files/working-with-non-code-files.md +++ /dev/null @@ -1,358 +0,0 @@ ---- -title: Working with non-code files -intro: '{% data variables.product.product_name %} supports rendering and diffing in a number of non-code file formats.' -redirect_from: - - /articles/rendering-and-diffing-images - - /github/managing-files-in-a-repository/rendering-and-diffing-images - - /github/managing-files-in-a-repository/working-with-non-code-files/rendering-and-diffing-images - - /articles/stl-file-viewer - - /articles/3d-file-viewer - - /github/managing-files-in-a-repository/3d-file-viewer - - /github/managing-files-in-a-repository/working-with-non-code-files/3d-file-viewer - - /articles/rendering-csv-and-tsv-data - - /github/managing-files-in-a-repository/rendering-csv-and-tsv-data - - /github/managing-files-in-a-repository/working-with-non-code-files/rendering-csv-and-tsv-data - - /articles/rendering-pdf-documents - - /github/managing-files-in-a-repository/rendering-pdf-documents - - /github/managing-files-in-a-repository/working-with-non-code-files/rendering-pdf-documents - - /articles/rendering-differences-in-prose-documents - - /github/managing-files-in-a-repository/rendering-differences-in-prose-documents - - /github/managing-files-in-a-repository/working-with-non-code-files/rendering-differences-in-prose-documents - - /articles/mapping-geojson-files-on-github - - /github/managing-files-in-a-repository/mapping-geojson-files-on-github - - /github/managing-files-in-a-repository/working-with-non-code-files/mapping-geojson-files-on-github - - /articles/working-with-jupyter-notebook-files-on-github - - /github/managing-files-in-a-repository/working-with-jupyter-notebook-files-on-github - - /github/managing-files-in-a-repository/working-with-non-code-files/working-with-jupyter-notebook-files-on-github - - /github/managing-files-in-a-repository/working-with-non-code-files -versions: - fpt: '*' - ghes: '*' - ghec: '*' -topics: - - Repositories -shortTitle: Working with non-code files ---- - -## Rendering and diffing images - -{% data variables.product.product_name %} can display several common image formats, including PNG, JPG, GIF, PSD, and SVG. In addition to simply displaying them, there are several ways to compare differences between versions of those image formats. - -{% note %} - -**Note:** -- {% data variables.product.prodname_dotcom %} does not support comparing the differences between PSD files. -- If you are using the Firefox browser, SVGs on {% data variables.product.prodname_dotcom %} may not render. - -{% endnote %} - -### Viewing images - -You can directly browse and view images in your repository on {% data variables.location.product_location %}. - -SVGs don't currently support inline scripting or animation. - -### Viewing differences - -You can visually compare images in three different modes: [2-up](#2-up), [swipe](#swipe), and [onion skin](#onion-skin). - -#### 2-up - -**2-up** is the default mode; it gives you a quick glimpse of both images. In addition, if the image has changed size between versions, the actual dimension change is displayed. This should make it very apparent when things are resized, such as when assets are upgraded to higher resolutions. - -![Screenshot of a diff for an image in 2-up mode. The image on the right is outlined in green and larger than the image on the left, which is outlined in red.](/assets/images/help/repository/images-2up-view.png) - -#### Swipe - -**Swipe** lets you view portions of your image side by side. Not sure if colors shifted between different versions? Drag the swipe slider over the area in question and compare the pixels for yourself. - -![Screenshot of a diff for an image in swipe mode. A line down the center divides the image into new, outlined in green, and old, outlined in red.](/assets/images/help/repository/images-swipe-view.png) - -#### Onion skin - -**Onion Skin** really comes in handy when elements move around by small, hard to notice amounts. Did an icon shift two pixels to the left? Drag the opacity slider back a bit and notice if things move around. - -## 3D File Viewer - -{% data variables.product.product_name %} can host and render 3D files with the _.stl_ extension. - -When looking directly at an STL file on {% data variables.product.product_name %} you can: - -- Click and drag to spin the model. -- Right click and drag to translate the view. -- Scroll to zoom in and out. -- Click the different view modes to change the view. - -### Fixing slow performance - -If you see {% octicon "info" aria-label="the info icon" %} in the corner of the viewer, with the tooltip "WebGL powered hardware support not available," then the WebGL technology is not available on your browser. - -WebGL is necessary to take advantage of your computer's hardware to its fullest. We recommend you try browsers like [Chrome](https://www.google.com/intl/en/chrome/browser/) or [Firefox](https://www.mozilla.org/en-US/firefox/new/), which ship with WebGL enabled. - -### Error: "Unable to display" - -If your model is invalid, GitHub may not be able to display the file. In addition, files that are larger than 10 MB are too big for GitHub to display. - -### Embedding your model elsewhere - -To display your 3D file elsewhere on the internet, modify this template and place it on any HTML page that supports JavaScript: - -```html - -``` - -For example, if your model's URL is [`github.com/skalnik/secret-bear-clip/blob/master/stl/clip.stl`](https://github.com/skalnik/secret-bear-clip/blob/master/stl/clip.stl), your embed code would be: - -```html - -``` - -By default, the embedded renderer is 420 pixels wide by 620 pixels high, but you can customize the output by passing height and width variables as parameters at the end of the URL, such as `?height=300&width=500`. - -{% tip %} - -**Note**: `ref` can be a branch or the hash to an individual commit (like `2391ae`). - -{% endtip %} - -### Rendering in Markdown - -You can embed ASCII STL syntax directly in Markdown. For more information, see "[AUTOTITLE](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-stl-3d-models)." - -## Rendering CSV and TSV data - -{% data variables.product.prodname_dotcom %} supports rendering tabular data in the form of _.csv_ (comma-separated) and ._tsv_ (tab-separated) files. - -![Screenshot of a rendered CSV file, with data shown in a table format.](/assets/images/help/repository/rendered-csv.png) - -When viewed, any _.csv_ or _.tsv_ file committed to a repository on {% data variables.location.product_location %} automatically renders as an interactive table, complete with headers and row numbering. By default, we'll always assume the first row is your header row. - -You can link to a particular row by clicking the row number, or select multiple rows by holding down the shift key. Just copy the URL and send it to a friend. - -### Searching data - -If you want to find a certain value in your dataset, you can start typing in the search bar directly above the file. The rows will filter automatically. - -### Handling errors - -Occasionally, you may discover that your CSV or TSV file isn't rendering. In those instances, a message appears above your raw text, suggesting what the error may be. - -![Screenshot of a text view of a CSV file. In the header, a message points out an error: "No commas found in this CSV file in line 0."](/assets/images/help/repository/csv-render-error.png) - -Common errors include: - -- Mismatched column counts. You must have the same number of separators in each row, even if the cell is blank -- Exceeding the file size. Our rendering only works for files up to 512KB. Anything bigger than that slows down the browser. -- Using unsupported delimiters, such as semicolons instead of commas. - -## Rendering PDF documents - -{% data variables.product.prodname_dotcom %} supports rendering of PDF documents. - -Currently, links within PDFs are ignored. - -## Rendering differences in prose documents - -Commits and pull requests that include prose documents have the ability to represent those documents with _source_ and _rendered_ views. - -The source view shows the raw text that has been typed, while the rendered -view shows how that text would look once it's rendered on {% data variables.product.product_name %}. For example, -this might be the difference between showing `**bold**` in Markdown, and **bold** in the rendered view. - -Prose rendering is supported for rendered documents supported by [github/markup](https://github.com/github/markup): - -- Markdown -- AsciiDoc -- Textile -- ReStructuredText -- Rdoc -- Org -- Creole -- MediaWiki -- Pod - -To see the changes made to the document as part of a commit, click {% octicon "file" aria-label="Display the rich diff" %}. - -![Screenshot of the diff for a Markdown file. In the header of the file, a file icon is outlined in dark orange.](/assets/images/help/repository/rendered-prose-diff.png) - -This "rich diff" highlights the code that has been added and removed. - -![Screenshot of the diff for a Markdown file. "@octo-org/core" is struck through, with a red background, followed by "@octocat", with a green background.](/assets/images/help/repository/rendered-prose-changes.png) - -### Disabling Markdown rendering - -{% data reusables.repositories.disabling-markdown-rendering %} - -### Visualizing attribute changes - -We provide a tooltip -describing changes to attributes that, unlike words, would not otherwise be visible in the rendered document. For example, if a link URL changes from one website to -another, we'd show a tooltip like this: - -![Screenshot of the diff for a Markdown file. A tooltip over a link says "href: /octo-org-repo/blob/CONTRIBUTING -> /octo-org/octo-repo/blob/docs/CONTRIBUTING."](/assets/images/help/repository/prose-diff-attributes.png) - -### Commenting on changes - -[Commit comments](/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request) can only -be added to files within the _source_ view, on a line-by-line basis. - -### Linking to headers - -As with [other rendered prose documents](/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes), -hovering over a header in your document creates a link icon. You can link readers -of your rendered prose diff to specific sections. - -### Viewing complex diffs - -Some pull requests involve a large number of changes with large, complex documents. When the changes take too long to analyze, {% data variables.product.product_name %} can't always produce a rendered view of the changes. If this happens, you'll see an error message when you click the rendered button. - -You can still use the source view to analyze and comment on changes. - -### Viewing HTML elements - -We don't directly support rendered views of commits to HTML documents. Some formats, such as Markdown, let you embed arbitrary HTML in a document. When these documents are shown on {% data variables.product.product_name %}, some of that embedded HTML can be shown in a preview, while some (like an embedded YouTube video) cannot. - -In general, rendered views of changes to a document containing embedded HTML will show changes to the elements that are supported in {% data variables.product.product_name %}'s view of the document. Changes to documents containing embedded HTML should always be reviewed in both the rendered and source views for completeness. - -## Mapping GeoJSON/TopoJSON files on {% data variables.product.prodname_dotcom %} - -{% data variables.product.product_name %} supports rendering GeoJSON and TopoJSON map files within {% data variables.product.product_name %} repositories. Commit the file as you would normally using a `.geojson` or `.topojson` extension. Files with a `.json` extension are also supported, but only if `type` is set to `FeatureCollection`, `GeometryCollection`, or `topology`. Then, navigate to the path of the GeoJSON/TopoJSON file on {% data variables.product.product_name %}. - -### Geometry types - -Maps on {% data variables.product.product_name %} use [Leaflet.js](http://leafletjs.com) and support all the geometry types outlined in [the geoJSON spec](http://www.geojson.org/geojson-spec.html) (Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection). TopoJSON files should be type "Topology" and adhere to the [TopoJSON spec](https://github.com/mbostock/topojson/wiki/Specification). - -{% ifversion geoJSON-with-MapBox %} - -### Styling features - -You can customize the way features are displayed, such as specifying a particular color or adding a descriptive icon, by passing additional metadata within the GeoJSON object's properties. The options are: - -- `marker-size` - `small`, `medium`, or `large` -- `marker-color` - valid RGB hex color -- `marker-symbol` - an icon ID from [the Maki project](https://mapbox.com/maki/) or a single alphanumeric character (a-z or 0-9). -- `stroke` - color of a polygon edge or line (RGB) -- `stroke-opacity` - opacity of a polygon edge or line (0.0 - 1.0) -- `stroke-width` - width of a polygon edge or line -- `fill` - the color of the interior of a polygon (GRB) -- `fill-opacity` - the opacity of the interior of a polygon (0.0-1.0) - -See [version 1.1.0 of the open simplestyle spec](https://github.com/mapbox/simplestyle-spec/tree/master/1.1.0) for more information. -{% endif %} - -### Embedding your map elsewhere - -Want to make your GeoJSON map available someplace other than {% data variables.product.product_name %}? Simply modify this template, and place it in any HTML page that supports JavaScript (for example, [{% data variables.product.prodname_pages %}](https://pages.github.com)): - -```html - -``` - -For example, if your map's URL is [github.com/benbalter/dc-wifi-social/blob/master/bars.geojson](https://github.com/benbalter/dc-wifi-social/blob/master/bars.geojson), your embed code would be: - -```html - -``` - -By default, the embedded map 420px x 620px, but you can customize the output by passing height and width variables as parameters at the end, such as `?height=300&width=500`. - -{% tip %} - -**Note**: `ref` can be a branch or the hash to an individual commit (like `2391ae`). - -{% endtip %} - -### Mapping in Markdown - -You can embed GeoJSON and TopoJSON directly in Markdown. For more information, see "[AUTOTITLE](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-geojson-and-topojson-maps)." - -{% data reusables.advanced-formatting.administrator-must-enable-mapping %} - -### Clustering - -If your map contains a large number of markers (roughly over 750), GitHub will automatically cluster nearby markers at higher zoom levels. Simply click the cluster or zoom in to see individual markers. - -### Something's up with the underlying map - -The underlying map data (street names, roads, etc.) are driven by [OpenStreetMap](http://www.openstreetmap.org/), a collaborative project to create a free editable map of the world. If you notice something's not quite right, since it's open source, simply [sign up](https://www.openstreetmap.org/user/new) and submit a fix. - -### Troubleshooting GeoJSON/TopoJSON files - -If you're having trouble rendering GeoJSON files, ensure you have a valid GeoJSON file by running it through a [GeoJSON linter](http://geojsonlint.com/). If your points aren't appearing where you'd expect (for example, in the middle of the ocean), it's likely that the data is in a projection which is currently unsupported. Currently, {% data variables.product.product_name %} only supports the `urn:ogc:def:crs:OGC:1.3:CRS84` projection. - -Additionally, if your `.geojson` file is especially large (over 10 MB), it is not possible to render within the browser. If that's the case, you'll generally see a message that says we can't show files that large. - -It may still be possible to render the data by converting the `.geojson` file to [TopoJSON](https://github.com/mbostock/topojson), a compression format that, in some cases, can reduce filesize by up to 80%. Of course, you can always break the file into smaller chunks (such as by state or by year), and store the data as multiple files within the repository. - -### Further reading about GeoJSON/TopoJSON - -{% ifversion geoJSON-with-MapBox %} -- [Leaflet.js documentation](https://leafletjs.com/) -- [MapBox marker-styling documentation](http://www.mapbox.com/developers/simplestyle/) -{%- else %} -- [Azure Maps documentation](https://docs.microsoft.com/en-us/azure/azure-maps/) -{%- endif %} -- [TopoJSON Wiki](https://github.com/mbostock/topojson/wiki) - -## Working with Jupyter Notebook files on {% data variables.product.prodname_dotcom %} - -When you add Jupyter Notebook or IPython Notebook files with a _.ipynb_ extension on {% data variables.location.product_location %}, they will render as static HTML files in your repository. - -The interactive features of the notebook, such as custom JavaScript plots, will not work in your repository on {% data variables.location.product_location %}. For an example, see [_Linking and Interactions.ipynb_](https://github.com/bokeh/bokeh-notebooks/blob/main/tutorial/06%20-%20Linking%20and%20Interactions.ipynb). - -To view your Jupyter notebook with JavaScript content rendered or to share your notebook files with others you can use [nbviewer](https://nbviewer.jupyter.org/). For an example, see [_Linking and Interactions.ipynb_](https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/main/tutorial/06%20-%20Linking%20and%20Interactions.ipynb) rendered on nbviewer. - -To view a fully interactive version of your Jupyter Notebook, you can set up a notebook server locally. For more information, see [Jupyter's official documentation](http://jupyter.readthedocs.io/en/latest/index.html). - -### Troubleshooting Jupyter Notebook files - -If you're having trouble rendering Jupyter Notebook files in static HTML, you can convert the file locally on the command line by using the [`nbconvert` command](https://github.com/jupyter/nbconvert): - -```shell -jupyter nbconvert --to html NOTEBOOK-NAME.ipynb -``` - -### Further reading about Jupyter Notebook - -- [Jupyter Notebook's GitHub repository](https://github.com/jupyter/jupyter_notebook) -- [Gallery of Jupyter Notebooks](https://github.com/jupyter/jupyter/wiki) - -## Displaying Mermaid files on {% data variables.product.prodname_dotcom %} - -{% data variables.product.product_name %} supports rendering Mermaid files within repositories. Commit the file as you would normally using a `.mermaid` or `.mmd` extension. Then, navigate to the path of the Mermaid file on {% data variables.product.prodname_dotcom %}. - -For example, if you add a `.mmd` file with the following content to your repository: - -```text -graph TD - A[Friend's Birthday] -->|Get money| B(Go shopping) - B --> C{Let me think} - C -->|One| D["Cool
Laptop"] - C -->|Two| E[iPhone] - C -->|Three| F[fa:fa-car Car] -``` - -When you view the file in the repository, it is rendered as a flow chart. - -![Screenshot of a flow chart. Two arrows point from a box labeled "A" to boxes labeled "B" and "C," and two more arrows point from "B" and "C" to "D."](/assets/images/help/repository/mermaid-file-diagram.png) - -### Troubleshooting Mermaid files - -If your chart does not render at all, verify that it contains valid Mermaid Markdown syntax by checking your chart with the [Mermaid live editor](https://mermaid.live/edit). - -If the chart displays, but does not appear as you'd expect, you can create a new [{% data variables.product.prodname_github_community %} discussion](https://github.com/orgs/community/discussions/categories/general), and add the `Mermaid` label. - -#### Known issues - -- Sequence diagram charts frequently render with additional padding below the chart, with more padding added as the chart size increases. This is a known issue with the Mermaid library. -- Actor nodes with popover menus do not work as expected within sequence diagram charts. This is due to a discrepancy in how JavaScript events are added to a chart when the Mermaid library's API is used to render a chart. -- Not all charts are a11y compliant. This may affect users who rely on a screen reader. - -### Mermaid in Markdown - -You can embed Mermaid syntax directly in Markdown. For more information, see "[AUTOTITLE](/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-mermaid-diagrams)." - -### Further reading about Mermaid - -- [Mermaid.js documentation](https://mermaid-js.github.io/mermaid/#/) -- [Mermaid.js live editor](https://mermaid.live/edit)