1
0
mirror of synced 2025-12-21 19:06:49 -05:00

moves categories from github to getting started and adds redirects

This commit is contained in:
Jules Parker
2022-01-12 15:50:21 +01:00
parent b45f4c5300
commit 97ddae3084
40 changed files with 59 additions and 23 deletions

View File

@@ -1,29 +0,0 @@
---
title: About GitHub Importer
intro: 'If you have source code in Subversion, Mercurial, Team Foundation Version Control (TFVC), or another Git repository, you can move it to GitHub using GitHub Importer.'
redirect_from:
- /articles/about-github-importer
- /github/importing-your-projects-to-github/about-github-importer
versions:
fpt: '*'
ghec: '*'
---
GitHub Importer is a tool that quickly imports source code repositories, including commits and revision history, to GitHub for you.
![Importing a repository gif](/assets/images/help/importer/github-importer.gif)
During an import, depending on the version control system you're importing from, you can authenticate with your remote repository, update commit author attribution, and import repositories with large files (or remove large files if you don't want to use Git Large File Storage).
| Import action | Subversion | Mercurial | TFVC | Git |
|:--------------|:----------:|:---------:|:----------------------:|:---:|
| Authenticate with remote repository | **X** | **X** | **X** | **X** |
| [Update commit author attribution](/articles/updating-commit-author-attribution-with-github-importer) | **X** | **X** | **X** | |
| Move large files to [Git Large File Storage](/articles/about-git-large-file-storage) | **X** | **X** | **X** | |
| Remove large files from your repository | **X** | **X** | **X** | |
## Further reading
- "[Importing a repository with GitHub Importer](/articles/importing-a-repository-with-github-importer)"
- "[Updating commit author attribution with GitHub Importer](/articles/updating-commit-author-attribution-with-github-importer)"
- "[Importing a Git repository using the command line](/articles/importing-a-git-repository-using-the-command-line)"
- "[Source code migration tools](/articles/source-code-migration-tools)"

View File

@@ -1,164 +0,0 @@
---
title: Adding an existing project to GitHub using the command line
intro: 'Putting your existing work on {% data variables.product.product_name %} can let you share and collaborate in lots of great ways.'
redirect_from:
- /articles/add-an-existing-project-to-github
- /articles/adding-an-existing-project-to-github-using-the-command-line
- /github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
shortTitle: Add a project locally
---
## About adding existing projects to {% data variables.product.product_name %}
{% tip %}
**Tip:** If you're most comfortable with a point-and-click user interface, try adding your project with {% data variables.product.prodname_desktop %}. For more information, see "[Adding a repository from your local computer to GitHub Desktop](/desktop/guides/contributing-to-projects/adding-a-repository-from-your-local-computer-to-github-desktop)" in the *{% data variables.product.prodname_desktop %} Help*.
{% endtip %}
{% data reusables.repositories.sensitive-info-warning %}
## Adding a project to {% data variables.product.product_name %} with {% data variables.product.prodname_cli %}
{% data variables.product.prodname_cli %} is an open source tool for using {% data variables.product.prodname_dotcom %} from your computer's command line. {% data variables.product.prodname_cli %} can simplify the process of adding an existing project to {% data variables.product.product_name %} using the command line. To learn more about {% data variables.product.prodname_cli %}, see "[About {% data variables.product.prodname_cli %}](/github-cli/github-cli/about-github-cli)."
1. In the command line, navigate to the root directory of your project.
1. Initialize the local directory as a Git repository.
```shell
git init -b main
```
1. Stage and commit all the files in your project
```shell
git add . && git commit -m "initial commit"
```
1. To create a repository for your project on GitHub, use the `gh repo create` subcommand. When prompted, select **Push an existing local repository to GitHub** and enter the desired name for your repository. If you want your project to belong to an organization instead of your user account, specify the organization name and project name with `organization-name/project-name`.
1. Follow the interactive prompts. To add the remote and push the repository, confirm yes when asked to add the remote and push the commits to the current branch.
1. Alternatively, to skip all the prompts, supply the path to the repository with the `--source` flag and pass a visibility flag (`--public`, `--private`, or `--internal`). For example, `gh repo create --source=. --public`. Specify a remote with the `--remote` flag. To push your commits, pass the `--push` flag. For more information about possible arguments, see the [GitHub CLI manual](https://cli.github.com/manual/gh_repo_create).
## Adding a project to {% data variables.product.product_name %} without {% data variables.product.prodname_cli %}
{% mac %}
1. [Create a new repository](/repositories/creating-and-managing-repositories/creating-a-new-repository) on {% data variables.product.product_location %}. To avoid errors, do not initialize the new repository with *README*, license, or `gitignore` files. You can add these files after your project has been pushed to {% data variables.product.product_name %}.
![Create New Repository drop-down](/assets/images/help/repository/repo-create.png)
{% data reusables.command_line.open_the_multi_os_terminal %}
3. Change the current working directory to your local project.
4. Initialize the local directory as a Git repository.
```shell
$ git init -b main
```
5. Add the files in your new local repository. This stages them for the first commit.
```shell
$ git add .
# Adds the files in the local repository and stages them for commit. {% data reusables.git.unstage-codeblock %}
```
6. Commit the files that you've staged in your local repository.
```shell
$ git commit -m "First commit"
# Commits the tracked changes and prepares them to be pushed to a remote repository. {% data reusables.git.reset-head-to-previous-commit-codeblock %}
```
7. At the top of your repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.product.product_location %}{% endif %}'s Quick Setup page, click {% octicon "clippy" aria-label="The copy to clipboard icon" %} to copy the remote repository URL.
![Copy remote repository URL field](/assets/images/help/repository/copy-remote-repository-url-quick-setup.png)
8. In Terminal, [add the URL for the remote repository](/github/getting-started-with-github/managing-remote-repositories) where your local repository will be pushed.
```shell
$ git remote add origin <em> &lt;REMOTE_URL> </em>
# Sets the new remote
$ git remote -v
# Verifies the new remote URL
```
9. [Push the changes](/github/getting-started-with-github/pushing-commits-to-a-remote-repository/) in your local repository to {% data variables.product.product_location %}.
```shell
$ git push -u origin main
# Pushes the changes in your local repository up to the remote repository you specified as the origin
```
{% endmac %}
{% windows %}
1. [Create a new repository](/articles/creating-a-new-repository) on {% data variables.product.product_location %}. To avoid errors, do not initialize the new repository with *README*, license, or `gitignore` files. You can add these files after your project has been pushed to {% data variables.product.product_name %}.
![Create New Repository drop-down](/assets/images/help/repository/repo-create.png)
{% data reusables.command_line.open_the_multi_os_terminal %}
3. Change the current working directory to your local project.
4. Initialize the local directory as a Git repository.
```shell
$ git init -b main
```
5. Add the files in your new local repository. This stages them for the first commit.
```shell
$ git add .
# Adds the files in the local repository and stages them for commit. {% data reusables.git.unstage-codeblock %}
```
6. Commit the files that you've staged in your local repository.
```shell
$ git commit -m "First commit"
# Commits the tracked changes and prepares them to be pushed to a remote repository. {% data reusables.git.reset-head-to-previous-commit-codeblock %}
```
7. At the top of your repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.product.product_location %}{% endif %}'s Quick Setup page, click {% octicon "clippy" aria-label="The copy to clipboard icon" %} to copy the remote repository URL.
![Copy remote repository URL field](/assets/images/help/repository/copy-remote-repository-url-quick-setup.png)
8. In the Command prompt, [add the URL for the remote repository](/github/getting-started-with-github/managing-remote-repositories) where your local repository will be pushed.
```shell
$ git remote add origin <em> &lt;REMOTE_URL> </em>
# Sets the new remote
$ git remote -v
# Verifies the new remote URL
```
9. [Push the changes](/github/getting-started-with-github/pushing-commits-to-a-remote-repository/) in your local repository to {% data variables.product.product_location %}.
```shell
$ git push origin main
# Pushes the changes in your local repository up to the remote repository you specified as the origin
```
{% endwindows %}
{% linux %}
1. [Create a new repository](/articles/creating-a-new-repository) on {% data variables.product.product_location %}. To avoid errors, do not initialize the new repository with *README*, license, or `gitignore` files. You can add these files after your project has been pushed to {% data variables.product.product_name %}.
![Create New Repository drop-down](/assets/images/help/repository/repo-create.png)
{% data reusables.command_line.open_the_multi_os_terminal %}
3. Change the current working directory to your local project.
4. Initialize the local directory as a Git repository.
```shell
$ git init -b main
```
5. Add the files in your new local repository. This stages them for the first commit.
```shell
$ git add .
# Adds the files in the local repository and stages them for commit. {% data reusables.git.unstage-codeblock %}
```
6. Commit the files that you've staged in your local repository.
```shell
$ git commit -m "First commit"
# Commits the tracked changes and prepares them to be pushed to a remote repository. {% data reusables.git.reset-head-to-previous-commit-codeblock %}
```
7. At the top of your repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.product.product_location %}{% endif %}'s Quick Setup page, click {% octicon "clippy" aria-label="The copy to clipboard icon" %} to copy the remote repository URL.
![Copy remote repository URL field](/assets/images/help/repository/copy-remote-repository-url-quick-setup.png)
8. In Terminal, [add the URL for the remote repository](/github/getting-started-with-github/managing-remote-repositories) where your local repository will be pushed.
```shell
$ git remote add origin <em> &lt;REMOTE_URL> </em>
# Sets the new remote
$ git remote -v
# Verifies the new remote URL
```
9. [Push the changes](/github/getting-started-with-github/pushing-commits-to-a-remote-repository/) in your local repository to {% data variables.product.product_location %}.
```shell
$ git push origin main
# Pushes the changes in your local repository up to the remote repository you specified as the origin
```
{% endlinux %}
## Further reading
- "[Adding a file to a repository](/repositories/working-with-files/managing-files/adding-a-file-to-a-repository#adding-a-file-to-a-repository-using-the-command-line)"

View File

@@ -1,46 +0,0 @@
---
title: Importing a Git repository using the command line
intro: '{% ifversion fpt %}If [GitHub Importer](/articles/importing-a-repository-with-github-importer) is not suitable for your purposes, such as if your existing code is hosted on a private network, then we recommend importing using the command line.{% else %}Importing Git projects using the command line is suitable when your existing code is hosted on a private network.{% endif %}'
redirect_from:
- /articles/importing-a-git-repository-using-the-command-line
- /github/importing-your-projects-to-github/importing-a-git-repository-using-the-command-line
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
shortTitle: Import repo locally
---
Before you start, make sure you know:
- Your {% data variables.product.product_name %} username
- The clone URL for the external repository, such as `https://external-host.com/user/repo.git` or `git://external-host.com/user/repo.git` (perhaps with a `user@` in front of the `external-host.com` domain name)
{% tip %}
For purposes of demonstration, we'll use:
- An external account named **extuser**
- An external Git host named `https://external-host.com`
- A {% data variables.product.product_name %} personal user account named **ghuser**
- A repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.product.product_location %}{% endif %} named **repo.git**
{% endtip %}
1. [Create a new repository on {% data variables.product.product_name %}](/articles/creating-a-new-repository). You'll import your external Git repository to this new repository.
2. On the command line, make a "bare" clone of the repository using the external clone URL. This creates a full copy of the data, but without a working directory for editing files, and ensures a clean, fresh export of all the old data.
```shell
$ git clone --bare https://external-host.com/<em>extuser</em>/<em>repo.git</em>
# Makes a bare clone of the external repository in a local directory
```
3. Push the locally cloned repository to {% data variables.product.product_name %} using the "mirror" option, which ensures that all references, such as branches and tags, are copied to the imported repository.
```shell
$ cd <em>repo.git</em>
$ git push --mirror https://{% data variables.command_line.codeblock %}/<em>ghuser</em>/<em>repo.git</em>
# Pushes the mirror to the new repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.product.product_location %}{% endif %}
```
4. Remove the temporary local repository.
```shell
$ cd ..
$ rm -rf <em>repo.git</em>
```

View File

@@ -1,44 +0,0 @@
---
title: Importing a repository with GitHub Importer
intro: 'If you have a project hosted on another version control system, you can automatically import it to GitHub using the GitHub Importer tool.'
redirect_from:
- /articles/importing-from-other-version-control-systems-to-github
- /articles/importing-a-repository-with-github-importer
- /github/importing-your-projects-to-github/importing-a-repository-with-github-importer
versions:
fpt: '*'
ghec: '*'
shortTitle: Use GitHub Importer
---
{% tip %}
**Tip:** GitHub Importer is not suitable for all imports. For example, if your existing code is hosted on a private network, our tool won't be able to access it. In these cases, we recommend [importing using the command line](/articles/importing-a-git-repository-using-the-command-line) for Git repositories or an external [source code migration tool](/articles/source-code-migration-tools) for projects imported from other version control systems.
{% endtip %}
If you'd like to match the commits in your repository to the authors' GitHub user accounts during the import, make sure every contributor to your repository has a GitHub account before you begin the import.
{% data reusables.repositories.repo-size-limit %}
1. In the upper-right corner of any page, click {% octicon "plus" aria-label="Plus symbol" %}, and then click **Import repository**.
![Import repository option in new repository menu](/assets/images/help/importer/import-repository.png)
2. Under "Your old repository's clone URL", type the URL of the project you want to import.
![Text field for URL of imported repository](/assets/images/help/importer/import-url.png)
3. Choose your user account or an organization to own the repository, then type a name for the repository on GitHub.
![Repository owner menu and repository name field](/assets/images/help/importer/import-repo-owner-name.png)
4. Specify whether the new repository should be *public* or *private*. For more information, see "[Setting repository visibility](/articles/setting-repository-visibility)."
![Public or private repository radio buttons](/assets/images/help/importer/import-public-or-private.png)
5. Review the information you entered, then click **Begin import**.
![Begin import button](/assets/images/help/importer/begin-import-button.png)
6. If your old project was protected by a password, type your login information for that project, then click **Submit**.
![Password form and Submit button for password-protected project](/assets/images/help/importer/submit-old-credentials-importer.png)
7. If there are multiple projects hosted at your old project's clone URL, choose the project you'd like to import, then click **Submit**.
![List of projects to import and Submit button](/assets/images/help/importer/choose-project-importer.png)
8. If your project contains files larger than 100 MB, choose whether to import the large files using [Git Large File Storage](/articles/versioning-large-files), then click **Continue**.
![Git Large File Storage menu and Continue button](/assets/images/help/importer/select-gitlfs-importer.png)
You'll receive an email when the repository has been completely imported.
## Further reading
- "[Updating commit author attribution with GitHub Importer](/articles/updating-commit-author-attribution-with-github-importer)"

View File

@@ -1,24 +0,0 @@
---
title: Importing source code to GitHub
intro: 'You can import repositories to GitHub using {% ifversion fpt %}GitHub Importer, the command line,{% else %}the command line{% endif %} or external migration tools.'
redirect_from:
- /articles/importing-an-external-git-repository
- /articles/importing-from-bitbucket
- /articles/importing-an-external-git-repo
- /articles/importing-your-project-to-github
- /articles/importing-source-code-to-github
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
children:
- /about-github-importer
- /importing-a-repository-with-github-importer
- /updating-commit-author-attribution-with-github-importer
- /importing-a-git-repository-using-the-command-line
- /adding-an-existing-project-to-github-using-the-command-line
- /source-code-migration-tools
shortTitle: Import code to GitHub
---

View File

@@ -1,57 +0,0 @@
---
title: Source code migration tools
intro: You can use external tools to move your projects to GitHub.
redirect_from:
- /articles/importing-from-subversion
- /articles/source-code-migration-tools
- /github/importing-your-projects-to-github/source-code-migration-tools
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
shortTitle: Code migration tools
---
{% ifversion fpt or ghec %}
We recommend using [GitHub Importer](/articles/about-github-importer) to import projects from Subversion, Mercurial, Team Foundation Version Control (TFVC), or another Git repository. You can also use these external tools to convert your project to Git.
{% endif %}
## Importing from Subversion
In a typical Subversion environment, multiple projects are stored in a single root repository. On GitHub, each of these projects will usually map to a separate Git repository for a user account or organization. We suggest importing each part of your Subversion repository to a separate GitHub repository if:
* Collaborators need to check out or commit to that part of the project separately from the other parts
* You want different parts to have their own access permissions
We recommend these tools for converting Subversion repositories to Git:
- [`git-svn`](https://git-scm.com/docs/git-svn)
- [svn2git](https://github.com/nirvdrum/svn2git)
## Importing from Mercurial
We recommend [hg-fast-export](https://github.com/frej/fast-export) for converting Mercurial repositories to Git.
## Importing from TFVC
We recommend [git-tfs](https://github.com/git-tfs/git-tfs) for moving changes between TFVC and Git.
For more information about moving from TFVC (a centralized version control system) to Git, see "[Plan your Migration to Git](https://docs.microsoft.com/devops/develop/git/centralized-to-git)" from the Microsoft docs site.
{% tip %}
**Tip:** After you've successfully converted your project to Git, you can [push it to {% data variables.product.prodname_dotcom %}](/github/getting-started-with-github/pushing-commits-to-a-remote-repository/).
{% endtip %}
{% ifversion fpt or ghec %}
## Further reading
- "[About GitHub Importer](/articles/about-github-importer)"
- "[Importing a repository with GitHub Importer](/articles/importing-a-repository-with-github-importer)"
- [{% data variables.product.prodname_learning %}]({% data variables.product.prodname_learning_link %})
{% endif %}

View File

@@ -1,43 +0,0 @@
---
title: Updating commit author attribution with GitHub Importer
intro: 'During an import, you can match commits in your repository with the GitHub account of the commit author.'
redirect_from:
- /articles/updating-commit-author-attribution-with-github-importer
- /github/importing-your-projects-to-github/updating-commit-author-attribution-with-github-importer
versions:
fpt: '*'
ghec: '*'
shortTitle: Update author GitHub Importer
---
GitHub Importer looks for GitHub users whose email addresses match the authors of the commits in the repository you're importing. You can then connect a commit to its author using their email address or the author's GitHub username.
## Updating commit authors
1. After you've imported your repository, on the import status page, click **Match authors**.
![Match authors button](/assets/images/help/importer/match-authors-button.png)
2. Next to the author whose information you'd like to update, click **Connect**.
![List of commit authors](/assets/images/help/importer/connect-commit-author.png)
3. Type the email address or GitHub username of the author, then press **Enter**.
## Attributing commits to a GitHub user with a public email address
If the author of a commit in your imported repository has a GitHub account associated with the email address they used to author the commits, and they haven't [set their commit email address as private](/articles/setting-your-commit-email-address), GitHub Importer will match the email address associated with the commit to the public email address associated with their GitHub account, and attribute the commit to their GitHub account.
## Attributing commits to a GitHub user without a public email address
If the author of a commit in your imported repository has neither set a public email address on their GitHub profile, nor [set their commit email address as private](/articles/setting-your-commit-email-address), GitHub Importer may not be able to match the email address associated with the commit with their GitHub account.
The commit author can resolve this by setting their email address as private. Their commits will then be attributed to `<username>@users.noreply.github.com`, and the imported commits will be associated with their GitHub account.
## Attributing commits using an email address
If the author's email address is not associated with their GitHub account, they can [add the address to their account](/articles/adding-an-email-address-to-your-github-account) after the import, and the commits will be correctly attributed.
If the author does not have a GitHub account, GitHub Importer will attribute their commits to the email address associated with the commits.
## Further reading
- "[About GitHub Importer](/articles/about-github-importer)"
- "[Importing a repository with GitHub Importer](/articles/importing-a-repository-with-github-importer)"
- "[Adding an email address to your account](/articles/adding-an-email-address-to-your-github-account/)"
- "[Setting your commit email address](/articles/setting-your-commit-email-address)"

View File

@@ -1,18 +0,0 @@
---
title: Importing your projects to GitHub
intro: 'You can import your source code to {% data variables.product.product_name %} using a variety of different methods.'
shortTitle: Importing your projects
redirect_from:
- /categories/67/articles
- /categories/importing
- /categories/importing-your-projects-to-github
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
children:
- /importing-source-code-to-github
- /working-with-subversion-on-github
---

View File

@@ -1,16 +0,0 @@
---
title: Working with Subversion on GitHub
intro: You can use Subversion clients and some Subversion workflows and properties with GitHub.
redirect_from:
- /articles/working-with-subversion-on-github
versions:
fpt: '*'
ghes: '*'
ghec: '*'
children:
- /what-are-the-differences-between-subversion-and-git
- /support-for-subversion-clients
- /subversion-properties-supported-by-github
shortTitle: Work with Subversion on GitHub
---

View File

@@ -1,27 +0,0 @@
---
title: Subversion properties supported by GitHub
intro: 'There are several Subversion workflows and properties that are similar to existing functionality on {% data variables.product.product_name %}.'
redirect_from:
- /articles/subversion-properties-supported-by-github
- /github/importing-your-projects-to-github/subversion-properties-supported-by-github
versions:
fpt: '*'
ghes: '*'
ghec: '*'
shortTitle: Properties supported by GitHub
---
## Executable files (svn:executable)
We convert `svn:executable` properties by updating the file mode directly before adding it to the Git repository.
## MIME types (svn:mime-type)
{% data variables.product.product_name %} internally tracks the mime-type properties of files and the commits that added them.
## Ignoring unversioned items (svn:ignore)
If you've set files and directories to be ignored in Subversion, {% data variables.product.product_name %} will track them internally. Files ignored by subversion clients are completely distinct from entries in a *.gitignore* file.
## Currently unsupported properties
{% data variables.product.product_name %} doesn't currently support `svn:externals`, `svn:global-ignores`, or any properties not listed above, including custom properties.

View File

@@ -1,133 +0,0 @@
---
title: Support for Subversion clients
intro: GitHub repositories can be accessed from both Git and Subversion (SVN) clients. This article covers using a Subversion client on GitHub and some common problems that you might run into.
redirect_from:
- /articles/support-for-subversion-clients
- /github/importing-your-projects-to-github/support-for-subversion-clients
versions:
fpt: '*'
ghes: '*'
ghec: '*'
shortTitle: Support for Subversion clients
---
GitHub supports Subversion clients via the HTTPS protocol. We use a Subversion bridge to communicate svn commands to GitHub.
## Supported Subversion features on GitHub
### Checkout
The first thing you'll want to do is a Subversion checkout. Since Git clones keep the working directory (where you edit files) separate from the repository data, there is only one branch in the working directory at a time.
Subversion checkouts are different: they mix the repository data in the working directories, so there is a working directory for each branch and tag you've checked out. For repositories with many branches and tags, checking out everything can be a bandwidth burden, so you should start with a partial checkout.
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.copy-clone-url %}
3. Make an empty checkout of the repository:
```shell
$ svn co --depth empty https://github.com/<em>user</em>/<em>repo</em>
> Checked out revision 1.
$ cd <em>repo</em>
```
4. Get the `trunk` branch. The Subversion bridge maps trunk to the Git HEAD branch.
```shell
$ svn up trunk
> A trunk
> A trunk/README.md
> A trunk/gizmo.rb
> Updated to revision 1.
```
5. Get an empty checkout of the `branches` directory. This is where all of the non-`HEAD` branches live, and where you'll be making feature branches.
```shell
$ svn up --depth empty branches
Updated to revision 1.
```
### Creating branches
You can also create branches using the Subversion bridge to GitHub.
From your svn client, make sure the default branch is current by updating `trunk`:
```shell
$ svn up trunk
> At revision 1.
```
Next, you can use `svn copy` to create a new branch:
```shell
$ svn copy trunk branches/more_awesome
> A branches/more_awesome
$ svn commit -m 'Added more_awesome topic branch'
> Adding branches/more_awesome
> Committed revision 2.
```
You can confirm that the new branch exists in the repository's branch dropdown:
![branch-snapshot](/assets/images/help/branch/svnflow-branch-snapshot.png)
You can also confirm the new branch via the command line:
```shell
$ git fetch
> From https://github.com/<em>user</em>/<em>repo</em>/
> * [new branch] more_awesome -> origin/more_awesome
```
### Making commits to Subversion
After you've added some features and fixed some bugs, you'll want to commit those
changes to GitHub. This works just like the Subversion you're used to. Edit your files, and use `svn commit` to record your changes:
```shell
$ svn status
> M gizmo.rb
$ svn commit -m 'Guard against known problems'
> Sending more_awesome/gizmo.rb
> Transmitting file data .
> Committed revision 3.
$ svn status
> ? test
$ svn add test
> A test
> A test/gizmo_test.rb
$ svn commit -m 'Test coverage for problems'
> Adding more_awesome/test
> Adding more_awesome/test/gizmo_test.rb
> Transmitting file data .
> Committed revision 4.
```
### Switching between branches
To switch between branches, you'll probably want to start with a checkout of `trunk`:
```shell
$ svn co --depth empty https://github.com/<em>user</em>/<em>repo</em>/trunk
```
Then, you can switch to another branch:
```shell
$ svn switch https://github.com/<em>user</em>/<em>repo</em>/branches/more_awesome
```
## Finding the Git commit SHA for a Subversion commit
GitHub's Subversion server exposes the Git commit sha for each Subversion commit.
To see the commit SHA, you should ask for the `git-commit` unversioned remote property.
```shell
$ svn propget git-commit --revprop -r HEAD https://github.com/<em>user</em>/<em>repo</em>
05fcc584ed53d7b0c92e116cb7e64d198b13c4e3
```
With this commit SHA, you can, for example, look up the corresponding Git commit on GitHub.
## Further reading
* "[Subversion properties supported by GitHub](/articles/subversion-properties-supported-by-github)"

View File

@@ -1,69 +0,0 @@
---
title: What are the differences between Subversion and Git?
intro: 'Subversion (SVN) repositories are similar to Git repositories, but there are several differences when it comes to the architecture of your projects.'
redirect_from:
- /articles/what-are-the-differences-between-svn-and-git
- /articles/what-are-the-differences-between-subversion-and-git
- /github/importing-your-projects-to-github/what-are-the-differences-between-subversion-and-git
versions:
fpt: '*'
ghes: '*'
ghec: '*'
shortTitle: Subversion & Git differences
---
## Directory structure
Each *reference*, or labeled snapshot of a commit, in a project is organized within specific subdirectories, such as `trunk`, `branches`, and `tags`. For example, an SVN project with two features under development might look like this:
sample_project/trunk/README.md
sample_project/trunk/lib/widget.rb
sample_project/branches/new_feature/README.md
sample_project/branches/new_feature/lib/widget.rb
sample_project/branches/another_new_feature/README.md
sample_project/branches/another_new_feature/lib/widget.rb
An SVN workflow looks like this:
* The `trunk` directory represents the latest stable release of a project.
* Active feature work is developed within subdirectories under `branches`.
* When a feature is finished, the feature directory is merged into `trunk` and removed.
Git projects are also stored within a single directory. However, Git obscures the details of its references by storing them in a special *.git* directory. For example, a Git project with two features under development might look like this:
sample_project/.git
sample_project/README.md
sample_project/lib/widget.rb
A Git workflow looks like this:
* A Git repository stores the full history of all of its branches and tags within the *.git* directory.
* The latest stable release is contained within the default branch.
* Active feature work is developed in separate branches.
* When a feature is finished, the feature branch is merged into the default branch and deleted.
Unlike SVN, with Git the directory structure remains the same, but the contents of the files change based on your branch.
## Including subprojects
A *subproject* is a project that's developed and managed somewhere outside of your main project. You typically import a subproject to add some functionality to your project without needing to maintain the code yourself. Whenever the subproject is updated, you can synchronize it with your project to ensure that everything is up-to-date.
In SVN, a subproject is called an *SVN external*. In Git, it's called a *Git submodule*. Although conceptually similar, Git submodules are not kept up-to-date automatically; you must explicitly ask for a new version to be brought into your project.
For more information, see "[Git Tools Submodules](https://git-scm.com/book/en/Git-Tools-Submodules)" in the Git documentation.
## Preserving history
SVN is configured to assume that the history of a project never changes. Git allows you to modify previous commits and changes using tools like [`git rebase`](/github/getting-started-with-github/about-git-rebase).
{% tip %}
[GitHub supports Subversion clients](/articles/support-for-subversion-clients), which may produce some unexpected results if you're using both Git and SVN on the same project. If you've manipulated Git's commit history, those same commits will always remain within SVN's history. If you accidentally committed some sensitive data, we have [an article that will help you remove it from Git's history](/articles/removing-sensitive-data-from-a-repository).
{% endtip %}
## Further reading
- "[Subversion properties supported by GitHub](/articles/subversion-properties-supported-by-github)"
- ["Branching and Merging" from the _Git SCM_ book](https://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging)
- "[Importing source code to GitHub](/articles/importing-source-code-to-github)"
- "[Source code migration tools](/articles/source-code-migration-tools)"

View File

@@ -12,12 +12,9 @@ versions:
ghae: '*'
children:
- /copilot
- /writing-on-github
- /importing-your-projects-to-github
- /customizing-your-github-workflow
- /extending-github
- /working-with-github-support
- /understanding-how-github-uses-and-protects-your-data
- /site-policy
- /site-policy-deprecated
---

View File

@@ -1,40 +0,0 @@
---
title: About GitHub's use of your data
redirect_from:
- /articles/about-github-s-use-of-your-data
- /articles/about-githubs-use-of-your-data
intro: '{% data variables.product.product_name %} uses your repository''s data to connect you to relevant tools, people, projects, and information.'
versions:
fpt: '*'
ghec: '*'
topics:
- Policy
- Legal
shortTitle: GitHub's use of your data
---
## About {% data variables.product.product_name %}'s use of your data
{% data variables.product.product_name %} aggregates metadata and parses content patterns for the purposes of delivering generalized insights within the product. It uses data from public repositories, and also uses metadata and aggregate data from private repositories when a repository's owner has chosen to share the data with {% data variables.product.product_name %} through an opt-in. If you opt a private repository into data use, then it will perform read-only analysis of that specific private repository.
{% data reusables.repositories.about-github-archive-program %} For more information, see "[About archiving content and data on {% data variables.product.prodname_dotcom %}](/github/creating-cloning-and-archiving-repositories/about-archiving-content-and-data-on-github#about-the-github-archive-program)."
{% data reusables.user_settings.export-data %} For more information, see "[Requesting an archive of your personal account's data](/articles/requesting-an-archive-of-your-personal-account-s-data)."
If you opt in to data use for a private repository, we will continue to treat your private data, source code, or trade secrets as confidential and private consistent with our [Terms of Service](/free-pro-team@latest/github/site-policy/github-terms-of-service). The information we learn only comes from aggregated data. For more information, see "[Managing data use settings for your private repository](/github/understanding-how-github-uses-and-protects-your-data/managing-data-use-settings-for-your-private-repository)."
We'll announce substantial new features that use metadata or aggregate data on the [{% data variables.product.prodname_dotcom %} blog](https://github.com/blog).
## How data improves security recommendations
As an example of how your data might be used, we can detect and alert you to a security vulnerability in your public repository's dependencies. For more information, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)."
To detect potential security vulnerabilities, {% data variables.product.product_name %} scans the contents of your dependency manifest file to draw a list of your project's dependencies.
{% data variables.product.product_name %} also learns from changes you make to your dependency manifest. For example, if you upgrade a vulnerable dependency to a safe version after getting a security alert and others do the same, {% data variables.product.product_name %} learns how to patch the vulnerability and can recommend a similar patch to affected repos.
## Privacy and data sharing
Private repository data is scanned by machine and never read by {% data variables.product.product_name %} staff. Human eyes will never see the contents of your private repositories, except as described in our [Terms of Service](/free-pro-team@latest/github/site-policy/github-terms-of-service#3-access).
Your individual personal or repository data will not be shared with third parties. We may share aggregate data learned from our analysis with our partners.

View File

@@ -1,15 +0,0 @@
---
title: Understanding how GitHub uses and protects your data
redirect_from:
- /categories/understanding-how-github-uses-and-protects-your-data
versions:
fpt: '*'
ghec: '*'
children:
- /about-githubs-use-of-your-data
- /requesting-an-archive-of-your-personal-accounts-data
- /managing-data-use-settings-for-your-private-repository
- /opting-into-or-out-of-the-github-archive-program-for-your-public-repository
shortTitle: How GitHub protects data
---

View File

@@ -1,35 +0,0 @@
---
title: Managing data use settings for your private repository
intro: 'To help {% data variables.product.product_name %} connect you to relevant tools, people, projects, and information, you can configure data use for your private repository.'
redirect_from:
- /articles/opting-into-or-out-of-data-use-for-your-private-repository
- /github/understanding-how-github-uses-and-protects-your-data/opting-into-or-out-of-data-use-for-your-private-repository
versions:
fpt: '*'
ghec: '*'
topics:
- Policy
- Legal
shortTitle: Manage data use for private repo
---
## About data use for your private repository
When you enable data use for your private repository, you'll be able to access the dependency graph, where you can track your repository's dependencies and receive {% data variables.product.prodname_dependabot_alerts %} when {% data variables.product.product_name %} detects vulnerable dependencies. For more information, see "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies#dependabot-alerts-for-vulnerable-dependencies)."
## Enabling or disabling data use features
{% data reusables.security.security-and-analysis-features-enable-read-only %}
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
{% data reusables.repositories.navigate-to-security-and-analysis %}
4. Under "Configure security and analysis features", to the right of the feature, click **Disable** or **Enable**.{% ifversion fpt %}
!["Enable" or "Disable" button for "Configure security and analysis" features](/assets/images/help/repository/security-and-analysis-disable-or-enable-fpt-private.png){% elsif ghec %}
!["Enable" or "Disable" button for "Configure security and analysis" features](/assets/images/help/repository/security-and-analysis-disable-or-enable-ghec-private.png){% endif %}
## Further reading
- "[About {% data variables.product.prodname_dotcom %}'s use of your data](/articles/about-github-s-use-of-your-data)"
- "[Viewing and updating vulnerable dependencies in your repository](/github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository)"
- "[Managing security and analysis settings for your repository](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository)"

View File

@@ -1,24 +0,0 @@
---
title: Opting into or out of the GitHub Archive Program for your public repository
intro: 'You can manage whether {% data variables.product.prodname_dotcom %} includes your public repository in the {% data variables.product.prodname_archive %} to help ensure the long-term preservation of the world''s open source software.'
permissions: 'People with admin permissions to a public repository can opt into or out of the {% data variables.product.prodname_archive %}.'
versions:
fpt: '*'
ghec: '*'
topics:
- Policy
- Legal
shortTitle: GitHub Archive program
---
{% data reusables.repositories.about-github-archive-program %} For more information, see "[About archiving content and data on {% data variables.product.prodname_dotcom %}](/github/creating-cloning-and-archiving-repositories/about-archiving-content-and-data-on-github#about-the-github-archive-program)."
If you opt out of the {% data variables.product.prodname_archive %} for a repository, the repository will be excluded from any long-term archives that {% data variables.product.prodname_dotcom %} may create in the future. We will also send a request to each of our partner organizations to remove the repository from their data.
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
3. Under "Features", select or unselect **Preserve this repository**.
![Checkbox for allowing {% data variables.product.prodname_dotcom %} to include your code in the {% data variables.product.prodname_archive %}](/assets/images/help/repository/github-archive-program-checkbox.png)
## Further reading
- [{% data variables.product.prodname_archive %} FAQ](https://archiveprogram.github.com/faq/)

View File

@@ -1,44 +0,0 @@
---
title: Requesting an archive of your personal accounts data
redirect_from:
- /articles/requesting-an-archive-of-your-personal-account-s-data
- /articles/requesting-an-archive-of-your-personal-accounts-data
intro: '{% data reusables.user_settings.export-data %}'
versions:
fpt: '*'
ghec: '*'
topics:
- Policy
- Legal
shortTitle: Request account archive
---
{% data variables.product.product_name %} stores repository and profile metadata from your personal account's activity. You can export your personal account's data through settings on {% data variables.product.prodname_dotcom_the_website %} or with the User Migration API.
For more information about the data {% data variables.product.product_name %} stores that is available for exporting, see "[Download a user migration archive](/rest/reference/migrations#download-a-user-migration-archive)" and "[About {% data variables.product.product_name %}'s use of your data](/articles/about-github-s-use-of-your-data).
When you request an export of your personal data through settings on {% data variables.product.prodname_dotcom_the_website %}, {% data variables.product.product_name %} packages your personal data in a `tar.gz` file and sends you an email to your primary email address with a download link.
By default, the download link expires after seven days. At any time before the download link expires, you can disable the link from your user settings. For more information, see "[Deleting access to an archive of your personal account's data](/articles/requesting-an-archive-of-your-personal-account-s-data/#deleting-access-to-an-archive-of-your-personal-accounts-data)."
If your operating system cannot natively unpack the `tar.gz` file, you can use a third-party tool to extract the archived files. For more information, see "[How to unzip a tar.gz file](https://opensource.com/article/17/7/how-unzip-targz-file)" on Opensource.com.
The generated `tar.gz` file reflects the data stored at the time you started the data export.
## Downloading an archive of your personal account's data
{% data reusables.user_settings.access_settings %}
{% data reusables.user_settings.account_settings %}
3. Under "Export account data", click **Start export** or **New export**.
![Start personal data export button highlighted](/assets/images/help/repository/export-personal-data.png)
![New personal data export button highlighted](/assets/images/help/repository/new-export.png)
4. Once the export is ready to download, {% data variables.product.product_name %} will send you a download link to your primary email address.
5. Click the download link in your email and re-enter your password if prompted.
6. You'll be redirected to a `tar.gz` file that you can download.
## Deleting access to an archive of your personal account's data
{% data reusables.user_settings.access_settings %}
{% data reusables.user_settings.account_settings %}
3. To disable the download link sent to your email before it expires, under "Export account data", find the data export download you want to disable and click **Delete**.
![Delete personal data export package button highlighted](/assets/images/help/repository/delete-export-personal-account-data.png)

View File

@@ -1,84 +0,0 @@
---
title: Creating gists
intro: 'You can create two kinds of gists: {% ifversion ghae %}internal{% else %}public{% endif %} and secret. Create {% ifversion ghae %}an internal{% else %}a public{% endif %} gist if you''re ready to share your ideas with {% ifversion ghae %}enterprise members{% else %}the world{% endif %} or a secret gist if you''re not.'
permissions: '{% data reusables.enterprise-accounts.emu-permission-gist %}'
redirect_from:
- /articles/about-gists
- /articles/cannot-delete-an-anonymous-gist
- /articles/deleting-an-anonymous-gist
- /articles/creating-gists
- /github/writing-on-github/creating-gists
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
## About gists
Every gist is a Git repository, which means that it can be forked and cloned. {% ifversion not ghae %}If you are signed in to {% data variables.product.product_name %} when{% else %}When{% endif %} you create a gist, the gist will be associated with your account and you will see it in your list of gists when you navigate to your {% data variables.gists.gist_homepage %}.
Gists can be {% ifversion ghae %}internal{% else %}public{% endif %} or secret. {% ifversion ghae %}Internal{% else %}Public{% endif %} gists show up in {% data variables.gists.discover_url %}, where {% ifversion ghae %}enterprise members{% else %}people{% endif %} can browse new gists as they're created. They're also searchable, so you can use them if you'd like other people to find and see your work.
Secret gists don't show up in {% data variables.gists.discover_url %} and are not searchable. Secret gists aren't private. If you send the URL of a secret gist to {% ifversion ghae %}another enterprise member{% else %}a friend{% endif %}, they'll be able to see it. However, if {% ifversion ghae %}any other enterprise member{% else %}someone you don't know{% endif %} discovers the URL, they'll also be able to see your gist. If you need to keep your code away from prying eyes, you may want to [create a private repository](/articles/creating-a-new-repository) instead.
{% data reusables.gist.cannot-convert-public-gists-to-secret %}
{% ifversion ghes %}
If your site administrator has disabled private mode, you can also use anonymous gists, which can be public or secret.
{% data reusables.gist.anonymous-gists-cannot-be-deleted %}
{% endif %}
You'll receive a notification when:
- You are the author of a gist.
- Someone mentions you in a gist.
- You subscribe to a gist, by clicking **Subscribe** at the top of any gist.
{% ifversion fpt or ghes or ghec %}
You can pin gists to your profile so other people can see them easily. For more information, see "[Pinning items to your profile](/articles/pinning-items-to-your-profile)."
{% endif %}
You can discover {% ifversion ghae %}internal{% else %}public{% endif %} gists others have created by going to the {% data variables.gists.gist_homepage %} and clicking **All Gists**. This will take you to a page of all gists sorted and displayed by time of creation or update. You can also search gists by language with {% data variables.gists.gist_search_url %}. Gist search uses the same search syntax as [code search](/search-github/searching-on-github/searching-code).
Since gists are Git repositories, you can view their full commit history, complete with diffs. You can also fork or clone gists. For more information, see ["Forking and cloning gists"](/articles/forking-and-cloning-gists).
You can download a ZIP file of a gist by clicking the **Download ZIP** button at the top of the gist. You can embed a gist in any text field that supports Javascript, such as a blog post. To get the embed code, click the clipboard icon next to the **Embed** URL of a gist. To embed a specific gist file, append the **Embed** URL with `?file=FILENAME`.
{% ifversion fpt or ghec %}
Gist supports mapping GeoJSON files. These maps are displayed in embedded gists, so you can easily share and embed maps. For more information, see "[Working with non-code files](/repositories/working-with-files/using-files/working-with-non-code-files#mapping-geojson-files-on-github)."
{% endif %}
## Creating a gist
Follow the steps below to create a gist.
{% ifversion fpt or ghes or ghae or ghec %}
{% note %}
You can also create a gist using the {% data variables.product.prodname_cli %}. For more information, see "[`gh gist create`](https://cli.github.com/manual/gh_gist_create)" in the {% data variables.product.prodname_cli %} documentation.
Alternatively, you can drag and drop a text file from your desktop directly into the editor.
{% endnote %}
{% endif %}
1. Sign in to {% data variables.product.product_name %}.
2. Navigate to your {% data variables.gists.gist_homepage %}.
3. Type an optional description and name for your gist.
![Gist name description](/assets/images/help/gist/gist_name_description.png)
4. Type the text of your gist into the gist text box.
![Gist text box](/assets/images/help/gist/gist_text_box.png)
5. Optionally, to create {% ifversion ghae %}an internal{% else %}a public{% endif %} gist, click {% octicon "triangle-down" aria-label="The downwards triangle icon" %}, then click **Create {% ifversion ghae %}internal{% else %}public{% endif %} gist**.
![Drop-down menu to select gist visibility]{% ifversion ghae %}(/assets/images/help/gist/gist-visibility-drop-down-ae.png){% else %}(/assets/images/help/gist/gist-visibility-drop-down.png){% endif %}
6. Click **Create secret Gist** or **Create {% ifversion ghae %}internal{% else %}public{% endif %} gist**.
![Button to create gist](/assets/images/help/gist/create-secret-gist-button.png)

View File

@@ -1,34 +0,0 @@
---
title: Forking and cloning gists
intro: 'Gists are actually Git repositories, which means that you can fork or clone any gist, even if you aren''t the original author. You can also view a gist''s full commit history, including diffs.'
permissions: '{% data reusables.enterprise-accounts.emu-permission-gist %}'
redirect_from:
- /articles/forking-and-cloning-gists
- /github/writing-on-github/forking-and-cloning-gists
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
## Forking gists
Each gist indicates which forks have activity, making it easy to find interesting changes from others.
![Gist forks](/assets/images/help/gist/gist_forks.png)
## Cloning gists
If you want to make local changes to a gist and push them up to the web, you can clone a gist and make commits the same as you would with any Git repository. For more information, see "[Cloning a repository](/articles/cloning-a-repository)."
![Gist clone button](/assets/images/help/gist/gist_clone_btn.png)
## Viewing gist commit history
To view a gist's full commit history, click the "Revisions" tab at the top of the gist.
![Gist revisions tab](/assets/images/help/gist/gist_revisions_tab.png)
You will see a full commit history for the gist with diffs.
![Gist revisions page](/assets/images/help/gist/gist_history.png)

View File

@@ -1,18 +0,0 @@
---
title: Editing and sharing content with gists
intro: ''
redirect_from:
- /categories/23/articles
- /categories/gists
- /articles/editing-and-sharing-content-with-gists
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
children:
- /creating-gists
- /forking-and-cloning-gists
shortTitle: Share content with gists
---

View File

@@ -1,44 +0,0 @@
---
title: About writing and formatting on GitHub
intro: GitHub combines a syntax for formatting text called GitHub Flavored Markdown with a few unique writing features.
redirect_from:
- /articles/about-writing-and-formatting-on-github
- /github/writing-on-github/about-writing-and-formatting-on-github
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
shortTitle: Write & format on GitHub
---
[Markdown](http://daringfireball.net/projects/markdown/) is an easy-to-read, easy-to-write syntax for formatting plain text.
We've added some custom functionality to create {% data variables.product.prodname_dotcom %} Flavored Markdown, used to format prose and code across our site.
You can also interact with other users in pull requests and issues using features like [@mentions](/articles/basic-writing-and-formatting-syntax/#mentioning-people-and-teams), [issue and PR references](/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests), and [emoji](/articles/basic-writing-and-formatting-syntax/#using-emoji).
## Text formatting toolbar
Every comment field on {% data variables.product.product_name %} contains a text formatting toolbar, allowing you to format your text without learning Markdown syntax. In addition to Markdown formatting like bold and italic styles and creating headers, links, and lists, the toolbar includes {% data variables.product.product_name %}-specific features such as @mentions, task lists, and links to issues and pull requests.
{% if fixed-width-font-gfm-fields %}
## Enabling fixed-width fonts in the editor
You can enable a fixed-width font in every comment field on {% data variables.product.product_name %}. Each character in a fixed-width, or monospace, font occupies the same horizontal space which can make it easier to edit advanced Markdown structures such as tables and code snippets.
![Screenshot showing the {% data variables.product.product_name %} comment field with fixed-width fonts enabled](/assets/images/help/writing/fixed-width-example.png)
{% data reusables.user_settings.access_settings %}
{% data reusables.user_settings.appearance-settings %}
1. Under "Markdown editor font preference", select **Use a fixed-width (monospace) font when editing Markdown**.
![Screenshot showing the {% data variables.product.product_name %} comment field with fixed width fonts enabled](/assets/images/help/writing/enable-fixed-width.png)
{% endif %}
## Further reading
- [{% data variables.product.prodname_dotcom %} Flavored Markdown Spec](https://github.github.com/gfm/)
- "[Basic writing and formatting syntax](/articles/basic-writing-and-formatting-syntax)"
- "[Working with advanced formatting](/articles/working-with-advanced-formatting)"
- "[Mastering Markdown](https://guides.github.com/features/mastering-markdown/)"

View File

@@ -1,342 +0,0 @@
---
title: Basic writing and formatting syntax
intro: Create sophisticated formatting for your prose and code on GitHub with simple syntax.
redirect_from:
- /articles/basic-writing-and-formatting-syntax
- /github/writing-on-github/basic-writing-and-formatting-syntax
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
shortTitle: Basic formatting syntax
---
## Headings
To create a heading, add one to six `#` symbols before your heading text. The number of `#` you use will determine the size of the heading.
```markdown
# The largest heading
## The second largest heading
###### The smallest heading
```
![Rendered H1, H2, and H6 headings](/assets/images/help/writing/headings-rendered.png)
## Styling text
You can indicate emphasis with bold, italic, or strikethrough text in comment fields and `.md` files.
| Style | Syntax | Keyboard shortcut | Example | Output |
| --- | --- | --- | --- | --- |
| Bold | `** **` or `__ __`| command/control + b | `**This is bold text**` | **This is bold text** |
| Italic | `* *` or `_ _` | command/control + i | `*This text is italicized*` | *This text is italicized* |
| Strikethrough | `~~ ~~` | | `~~This was mistaken text~~` | ~~This was mistaken text~~ |
| Bold and nested italic | `** **` and `_ _` | | `**This text is _extremely_ important**` | **This text is _extremely_ important** |
| All bold and italic | `*** ***` | | `***All this text is important***` | ***All this text is important*** |
## Quoting text
You can quote text with a `>`.
```markdown
Text that is not a quote
> Text that is a quote
```
![Rendered quoted text](/assets/images/help/writing/quoted-text-rendered.png)
{% tip %}
**Tip:** When viewing a conversation, you can automatically quote text in a comment by highlighting the text, then typing `r`. You can quote an entire comment by clicking {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %}, then **Quote reply**. For more information about keyboard shortcuts, see "[Keyboard shortcuts](/articles/keyboard-shortcuts/)."
{% endtip %}
## Quoting code
You can call out code or a command within a sentence with single backticks. The text within the backticks will not be formatted.{% ifversion fpt or ghae or ghes > 3.1 or ghec %} You can also press the `command` or `Ctrl` + `e` keyboard shortcut to insert the backticks for a code block within a line of Markdown.{% endif %}
```markdown
Use `git status` to list all new or modified files that haven't yet been committed.
```
![Rendered inline code block](/assets/images/help/writing/inline-code-rendered.png)
To format code or text into its own distinct block, use triple backticks.
<pre>
Some basic Git commands are:
```
git status
git add
git commit
```
</pre>
![Rendered code block](/assets/images/help/writing/code-block-rendered.png)
For more information, see "[Creating and highlighting code blocks](/articles/creating-and-highlighting-code-blocks)."
{% data reusables.user_settings.enabling-fixed-width-fonts %}
## Links
You can create an inline link by wrapping link text in brackets `[ ]`, and then wrapping the URL in parentheses `( )`. {% ifversion fpt or ghae or ghes > 3.1 or ghec %}You can also use the keyboard shortcut `command + k` to create a link.{% endif %}{% ifversion fpt or ghae-issue-5434 or ghes > 3.3 or ghec %} When you have text selected, you can paste a URL from your clipboard to automatically create a link from the selection.{% endif %}
`This site was built using [GitHub Pages](https://pages.github.com/).`
![Rendered link](/assets/images/help/writing/link-rendered.png)
{% tip %}
**Tip:** {% data variables.product.product_name %} automatically creates links when valid URLs are written in a comment. For more information, see "[Autolinked references and URLs](/articles/autolinked-references-and-urls)."
{% endtip %}
## Section links
{% data reusables.repositories.section-links %}
## Relative links
{% data reusables.repositories.relative-links %}
## Images
You can display an image by adding `!` and wrapping the alt text in`[ ]`. Then wrap the link for the image in parentheses `()`.
`![This is an image](https://myoctocat.com/assets/images/base-octocat.svg)`
![Rendered Image](/assets/images/help/writing/image-rendered.png)
{% data variables.product.product_name %} supports embedding images into your issues, pull requests{% ifversion fpt or ghec %}, discussions{% endif %}, comments and `.md` files. You can display an image from your repository, add a link to an online image, or upload an image. For more information, see "[Uploading assets](#uploading-assets)."
{% tip %}
**Tip:** When you want to display an image which is in your repository, you should use relative links instead of absolute links.
{% endtip %}
Here are some examples for using relative links to display an image.
| Context | Relative Link |
| ------ | -------- |
| In a `.md` file on the same branch | `/assets/images/electrocat.png` |
| In a `.md` file on another branch | `/../main/assets/images/electrocat.png` |
| In issues, pull requests and comments of the repository | `../blob/main/assets/images/electrocat.png` |
| In a `.md` file in another repository | `/../../../../github/docs/blob/main/assets/images/electrocat.png` |
| In issues, pull requests and comments of another repository | `../../../github/docs/blob/main/assets/images/electrocat.png?raw=true` |
{% note %}
**Note**: The last two relative links in the table above will work for images in a private repository only if the viewer has at least read access to the private repository which contains these images.
{% endnote %}
For more information, see "[Relative Links](#relative-links)."
{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5559 %}
### Specifying the theme an image is shown to
You can specify the theme an image is displayed to by appending `#gh-dark-mode-only` or `#gh-light-mode-only` to the end of an image URL, in Markdown.
We distinguish between light and dark color modes, so there are two options available. You can use these options to display images optimized for dark or light backgrounds. This is particularly helpful for transparent PNG images.
| Context | URL |
|--------|--------|
| Dark Theme | `![GitHub Light](https://github.com/github-light.png#gh-dark-mode-only)` |
| Light Theme | `![GitHub Dark](https://github.com/github-dark.png#gh-light-mode-only)` |
{% endif %}
## Lists
You can make an unordered list by preceding one or more lines of text with `-` or `*`.
```markdown
- George Washington
- John Adams
- Thomas Jefferson
```
![Rendered unordered list](/assets/images/help/writing/unordered-list-rendered.png)
To order your list, precede each line with a number.
```markdown
1. James Madison
2. James Monroe
3. John Quincy Adams
```
![Rendered ordered list](/assets/images/help/writing/ordered-list-rendered.png)
### Nested Lists
You can create a nested list by indenting one or more list items below another item.
To create a nested list using the web editor on {% data variables.product.product_name %} or a text editor that uses a monospaced font, like [Atom](https://atom.io/), you can align your list visually. Type space characters in front of your nested list item, until the list marker character (`-` or `*`) lies directly below the first character of the text in the item above it.
```markdown
1. First list item
- First nested list item
- Second nested list item
```
![Nested list with alignment highlighted](/assets/images/help/writing/nested-list-alignment.png)
![List with two levels of nested items](/assets/images/help/writing/nested-list-example-1.png)
To create a nested list in the comment editor on {% data variables.product.product_name %}, which doesn't use a monospaced font, you can look at the list item immediately above the nested list and count the number of characters that appear before the content of the item. Then type that number of space characters in front of the nested list item.
In this example, you could add a nested list item under the list item `100. First list item` by indenting the nested list item a minimum of five spaces, since there are five characters (`100. `) before `First list item`.
```markdown
100. First list item
- First nested list item
```
![List with a nested list item](/assets/images/help/writing/nested-list-example-3.png)
You can create multiple levels of nested lists using the same method. For example, because the first nested list item has seven characters (`␣␣␣␣␣-␣`) before the nested list content `First nested list item`, you would need to indent the second nested list item by seven spaces.
```markdown
100. First list item
- First nested list item
- Second nested list item
```
![List with two levels of nested items](/assets/images/help/writing/nested-list-example-2.png)
For more examples, see the [GitHub Flavored Markdown Spec](https://github.github.com/gfm/#example-265).
## Task lists
{% data reusables.repositories.task-list-markdown %}
If a task list item description begins with a parenthesis, you'll need to escape it with `\`:
`- [ ] \(Optional) Open a followup issue`
For more information, see "[About task lists](/articles/about-task-lists)."
## Mentioning people and teams
You can mention a person or [team](/articles/setting-up-teams/) on {% data variables.product.product_name %} by typing `@` plus their username or team name. This will trigger a notification and bring their attention to the conversation. People will also receive a notification if you edit a comment to mention their username or team name. For more information about notifications, see {% ifversion fpt or ghes or ghae or ghec %}"[About notifications](/github/managing-subscriptions-and-notifications-on-github/about-notifications){% else %}"[About notifications](/github/receiving-notifications-about-activity-on-github/about-notifications){% endif %}."
`@github/support What do you think about these updates?`
![Rendered @mention](/assets/images/help/writing/mention-rendered.png)
When you mention a parent team, members of its child teams also receive notifications, simplifying communication with multiple groups of people. For more information, see "[About teams](/articles/about-teams)."
Typing an `@` symbol will bring up a list of people or teams on a project. The list filters as you type, so once you find the name of the person or team you are looking for, you can use the arrow keys to select it and press either tab or enter to complete the name. For teams, enter the @organization/team-name and all members of that team will get subscribed to the conversation.
The autocomplete results are restricted to repository collaborators and any other participants on the thread.
## Referencing issues and pull requests
You can bring up a list of suggested issues and pull requests within the repository by typing `#`. Type the issue or pull request number or title to filter the list, and then press either tab or enter to complete the highlighted result.
For more information, see "[Autolinked references and URLs](/articles/autolinked-references-and-urls)."
## Referencing external resources
{% data reusables.repositories.autolink-references %}
{% ifversion ghes < 3.4 %}
## Content attachments
Some {% data variables.product.prodname_github_apps %} provide information in {% data variables.product.product_name %} for URLs that link to their registered domains. {% data variables.product.product_name %} renders the information provided by the app under the URL in the body or comment of an issue or pull request.
![Content attachment](/assets/images/github-apps/content_reference_attachment.png)
To see content attachments, you must have a {% data variables.product.prodname_github_app %} that uses the Content Attachments API installed on the repository.{% ifversion fpt or ghec %} For more information, see "[Installing an app in your personal account](/articles/installing-an-app-in-your-personal-account)" and "[Installing an app in your organization](/articles/installing-an-app-in-your-organization)."{% endif %}
Content attachments will not be displayed for URLs that are part of a markdown link.
For more information about building a {% data variables.product.prodname_github_app %} that uses content attachments, see "[Using Content Attachments](/apps/using-content-attachments)."{% endif %}
## Uploading assets
You can upload assets like images by dragging and dropping, selecting from a file browser, or pasting. You can upload assets to issues, pull requests, comments, and `.md` files in your repository.
## Using emoji
You can add emoji to your writing by typing `:EMOJICODE:`.
`@octocat :+1: This PR looks great - it's ready to merge! :shipit:`
![Rendered emoji](/assets/images/help/writing/emoji-rendered.png)
Typing `:` will bring up a list of suggested emoji. The list will filter as you type, so once you find the emoji you're looking for, press **Tab** or **Enter** to complete the highlighted result.
For a full list of available emoji and codes, check out [the Emoji-Cheat-Sheet](https://github.com/ikatyang/emoji-cheat-sheet/blob/master/README.md).
## Paragraphs
You can create a new paragraph by leaving a blank line between lines of text.
{% ifversion fpt or ghae-issue-5180 or ghes > 3.2 or ghec %}
## Footnotes
You can add footnotes to your content by using this bracket syntax:
```
Here is a simple footnote[^1].
A footnote can also have multiple lines[^2].
You can also use words, to fit your writing style more closely[^note].
[^1]: My reference.
[^2]: Every new line should be prefixed with 2 spaces.
This allows you to have a footnote with multiple lines.
[^note]:
Named footnotes will still render with numbers instead of the text but allow easier identification and linking.
This footnote also has been made with a different syntax using 4 spaces for new lines.
```
The footnote will render like this:
![Rendered footnote](/assets/images/site/rendered-footnote.png)
{% tip %}
**Note**: The position of a footnote in your Markdown does not influence where the footnote will be rendered. You can write a footnote right after your reference to the footnote, and the footnote will still render at the bottom of the Markdown.
{% endtip %}
{% endif %}
## Hiding content with comments
You can tell {% data variables.product.product_name %} to hide content from the rendered Markdown by placing the content in an HTML comment.
<pre>
&lt;!-- This content will not appear in the rendered Markdown --&gt;
</pre>
## Ignoring Markdown formatting
You can tell {% data variables.product.product_name %} to ignore (or escape) Markdown formatting by using `\` before the Markdown character.
`Let's rename \*our-new-project\* to \*our-old-project\*.`
![Rendered escaped character](/assets/images/help/writing/escaped-character-rendered.png)
For more information, see Daring Fireball's "[Markdown Syntax](https://daringfireball.net/projects/markdown/syntax#backslash)."
{% ifversion fpt or ghes > 3.2 or ghae-issue-5232 or ghec %}
## Disabling Markdown rendering
{% data reusables.repositories.disabling-markdown-rendering %}
{% endif %}
## Further reading
- [{% data variables.product.prodname_dotcom %} Flavored Markdown Spec](https://github.github.com/gfm/)
- "[About writing and formatting on GitHub](/articles/about-writing-and-formatting-on-github)"
- "[Working with advanced formatting](/articles/working-with-advanced-formatting)"
- "[Mastering Markdown](https://guides.github.com/features/mastering-markdown/)"

View File

@@ -1,18 +0,0 @@
---
title: Getting started with writing and formatting on GitHub
redirect_from:
- /articles/markdown-basics
- /articles/things-you-can-do-in-a-text-area-on-github
- /articles/getting-started-with-writing-and-formatting-on-github
intro: 'You can use simple features to format your comments and interact with others in issues, pull requests, and wikis on GitHub.'
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
children:
- /about-writing-and-formatting-on-github
- /basic-writing-and-formatting-syntax
shortTitle: Start writing on GitHub
---

View File

@@ -1,20 +0,0 @@
---
title: Writing on GitHub
redirect_from:
- /categories/88/articles
- /articles/github-flavored-markdown
- /articles/writing-on-github
- /categories/writing-on-github
intro: 'You can structure the information shared on {% data variables.product.product_name %} with various formatting options.'
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
children:
- /getting-started-with-writing-and-formatting-on-github
- /working-with-advanced-formatting
- /working-with-saved-replies
- /editing-and-sharing-content-with-gists
---

View File

@@ -1,60 +0,0 @@
---
title: Attaching files
intro: You can convey information by attaching a variety of file types to your issues and pull requests.
redirect_from:
- /github/managing-your-work-on-github/managing-your-work-with-issues-and-pull-requests/file-attachments-on-issues-and-pull-requests
- /articles/issue-attachments
- /articles/file-attachments-on-issues-and-pull-requests
- /github/managing-your-work-on-github/file-attachments-on-issues-and-pull-requests
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
topics:
- Pull requests
---
{% warning %}
**Warning:** If you add an image{% ifversion fpt or ghes > 3.1 or ghae or ghec %} or video{% endif %} to a pull request or issue comment, anyone can view the anonymized URL without authentication, even if the pull request is in a private repository{% ifversion ghes %}, or if private mode is enabled{% endif %}. To keep sensitive media files private, serve them from a private network or server that requires authentication. {% ifversion fpt or ghec %}For more information on anonymized URLs see "[About anonymized URLs](/github/authenticating-to-github/about-anonymized-urls)".{% endif %}
{% endwarning %}
To attach a file to an issue or pull request conversation, drag and drop it into the comment box. Alternatively, you can click the bar at the bottom of the comment box to browse, select, and add a file from your computer.
![Select attachments from computer](/assets/images/help/pull_requests/select-bar.png)
{% tip %}
**Tip:** In many browsers, you can copy-and-paste images directly into the box.
{% endtip %}
The maximum file size is:
- 10MB for images and gifs{% ifversion fpt or ghec %}
- 10MB for videos uploaded to a repository owned by a user or organization on a free GitHub plan
- 100MB for videos uploaded to a repository owned by a user or organization on a paid GitHub plan{% elsif fpt or ghes > 3.1 or ghae %}
- 100MB for videos{% endif %}
- 25MB for all other files
We support these files:
* PNG (*.png*)
* GIF (*.gif*)
* JPEG (*.jpg*)
* Log files (*.log*)
* Microsoft Word (*.docx*), Powerpoint (*.pptx*), and Excel (*.xlsx*) documents
* Text files (*.txt*)
* PDFs (*.pdf*)
* ZIP (*.zip*, *.gz*){% ifversion fpt or ghes > 3.1 or ghae or ghec %}
* Video (*.mp4*, *.mov*)
{% note %}
**Note:** Video codec compatibility is browser specific, and it's possible that a video you upload to one browser is not viewable on another browser. At the moment we recommend using h.264 for greatest compatibility.
{% endnote %}
{% endif %}
![Attachments animated GIF](/assets/images/help/pull_requests/dragging_images.gif)

View File

@@ -1,63 +0,0 @@
---
title: Autolinked references and URLs
intro: 'References to URLs, issues, pull requests, and commits are automatically shortened and converted into links.'
redirect_from:
- /articles/autolinked-references-and-urls
- /github/writing-on-github/autolinked-references-and-urls
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
shortTitle: Auto linked references
---
## URLs
{% data variables.product.product_name %} automatically creates links from standard URLs.
`Visit https://github.com`
![Rendered autolinked URL](/assets/images/help/writing/url-autolink-rendered.png)
For more information on creating links, see "[Basic writing and formatting syntax](/articles/basic-writing-and-formatting-syntax/#links)."
## Issues and pull requests
Within conversations on {% data variables.product.product_name %}, references to issues and pull requests are automatically converted to shortened links.
{% note %}
**Note:** Autolinked references are not created in wikis or files in a repository.
{% endnote %}
| Reference type | Raw reference | Short link |
| --- | --- | --- |
| Issue or pull request URL | https://github.com/jlord/sheetsee.js/issues/26 | [#26](https://github.com/jlord/sheetsee.js/issues/26)
| `#` and issue or pull request number | #26 | [#26](https://github.com/jlord/sheetsee.js/issues/26) |
| `GH-` and issue or pull request number | GH-26 | [GH-26](https://github.com/jlord/sheetsee.js/issues/26) |
| `Username/Repository#` and issue or pull request number | jlord/sheetsee.js#26 | [jlord/sheetsee.js#26](https://github.com/jlord/sheetsee.js/issues/26)
| `Organization_name/Repository#` and issue or pull request number | github/linguist#4039 | [github/linguist#4039](https://github.com/github/linguist/pull/4039)
{% ifversion fpt or ghec %}
If you reference an issue, pull request, or discussion in a list, the reference will unfurl to show the title and state instead. For more information about task lists, see "[About task lists](/issues/tracking-your-work-with-issues/creating-issues/about-task-lists)."
{% endif %}
## Commit SHAs
References to a commit's SHA hash are automatically converted into shortened links to the commit on {% data variables.product.product_name %}.
| Reference type | Raw reference | Short link |
| --- | --- | --- |
| Commit URL | [`https://github.com/jlord/sheetsee.js/commit/a5c3785ed8d6a35868bc169f07e40e889087fd2e`](https://github.com/jlord/sheetsee.js/commit/a5c3785ed8d6a35868bc169f07e40e889087fd2e) | [a5c3785](https://github.com/jlord/sheetsee.js/commit/a5c3785ed8d6a35868bc169f07e40e889087fd2e) |
| SHA | a5c3785ed8d6a35868bc169f07e40e889087fd2e | [a5c3785](https://github.com/jlord/sheetsee.js/commit/a5c3785ed8d6a35868bc169f07e40e889087fd2e) |
| User@SHA | jlord@a5c3785ed8d6a35868bc169f07e40e889087fd2e | [jlord@a5c3785](https://github.com/jlord/sheetsee.js/commit/a5c3785ed8d6a35868bc169f07e40e889087fd2e)
| `Username/Repository@SHA` | `jlord/sheetsee.js@a5c3785ed8d6a35868bc169f07e40e889087fd2e` | [`jlord/sheetsee.js@a5c3785`](https://github.com/jlord/sheetsee.js/commit/a5c3785ed8d6a35868bc169f07e40e889087fd2e) |
## Custom autolinks to external resources
{% data reusables.repositories.autolink-references %}
## Further reading
- "[Basic writing and formatting syntax](/articles/basic-writing-and-formatting-syntax)"

View File

@@ -1,50 +0,0 @@
---
title: Creating a permanent link to a code snippet
intro: 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.
redirect_from:
- /github/managing-your-work-on-github/managing-your-work-with-issues-and-pull-requests/creating-a-permanent-link-to-a-code-snippet
- /articles/creating-a-permanent-link-to-a-code-snippet
- /github/managing-your-work-on-github/creating-a-permanent-link-to-a-code-snippet
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
topics:
- Pull requests
shortTitle: Permanent links to code
---
## Linking to code
This type of permanent link will render as a code snippet only in the repository it originated in. In other repositories, the permalink code snippet will render as a URL.
![Code snippet rendered in a comment](/assets/images/help/repository/rendered-code-snippet.png)
{% tip %}
**Tip:** To create a permalink for an entire file, see "[Getting permanent links to files](/articles/getting-permanent-links-to-files)."
{% endtip %}
{% data reusables.repositories.navigate-to-repo %}
2. Locate the code you'd like to link to:
- To link to code from a file, navigate to the file.
- To link to code from a pull request, navigate to the pull request and click {% octicon "diff" aria-label="The file diff icon" %} **Files changed**. Then, browse to the file that contains the code you want include in your comment, and click **View**.
{% data reusables.repositories.choose-line-or-range %}
4. To the left of the line or range of lines, click {% octicon "kebab-horizontal" aria-label="The horizontal kebab octicon" %}. In the drop-down menu, click **Copy permalink**.
![Kebab menu with option to copy a permanent link for a selected line](/assets/images/help/repository/copy-permalink-specific-line.png)
5. Navigate to the conversation where you want to link to the code snippet.
6. Paste your permalink into a comment, and click **Comment**.
![Pasted permalink in a comment in the same repository](/assets/images/help/repository/code-snippet-permalink-in-comment.png)
## Linking to Markdown
You can link to specific lines in Markdown files by loading the Markdown file without Markdown rendering. To load a Markdown file without rendering, you can use the `?plain=1` parameter at the end of the url for the file. For example, `github.com/<organization>/<repository>/blob/<branch_name>/README.md?plain=1`.
You can link to a specific line in the Markdown file the same way you can in code. Append `#L` with the line number or numbers at the end of the url. For example, `github.com/<organization>/<repository>/blob/<branch_name>/README.md?plain=1#L14` will highlight line 14 in the plain README.md file.
## Further reading
- "[Creating an issue](/articles/creating-an-issue/)"
- "[Opening an issue from code](/articles/opening-an-issue-from-code/)"
- "[Reviewing changes in pull requests](/articles/reviewing-changes-in-pull-requests/)"

View File

@@ -1,71 +0,0 @@
---
title: Creating and highlighting code blocks
intro: Share samples of code with fenced code blocks and enabling syntax highlighting.
redirect_from:
- /articles/creating-and-highlighting-code-blocks
- /github/writing-on-github/creating-and-highlighting-code-blocks
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
shortTitle: Create code blocks
---
## Fenced code blocks
You can create fenced code blocks by placing triple backticks <code>\`\`\`</code> before and after the code block. We recommend placing a blank line before and after code blocks to make the raw formatting easier to read.
<pre>
```
function test() {
console.log("notice the blank line before this function?");
}
```
</pre>
![Rendered fenced code block](/assets/images/help/writing/fenced-code-block-rendered.png)
{% tip %}
**Tip:** To preserve your formatting within a list, make sure to indent non-fenced code blocks by eight spaces.
{% endtip %}
To display triple backticks in a fenced code block, wrap them inside quadruple backticks.
<pre>
````
```
Look! You can see my backticks.
```
````
</pre>
![Rendered fenced code with backticks block](/assets/images/help/writing/fenced-code-show-backticks-rendered.png)
{% data reusables.user_settings.enabling-fixed-width-fonts %}
## Syntax highlighting
<!-- If you make changes to this feature, update /getting-started-with-github/github-language-support to reflect any changes to supported languages. -->
You can add an optional language identifier to enable syntax highlighting in your fenced code block.
For example, to syntax highlight Ruby code:
```ruby
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
```
![Rendered code block with Ruby syntax highlighting](/assets/images/help/writing/code-block-syntax-highlighting-rendered.png)
We use [Linguist](https://github.com/github/linguist) to perform language detection and to select [third-party grammars](https://github.com/github/linguist/blob/master/vendor/README.md) for syntax highlighting. You can find out which keywords are valid in [the languages YAML file](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml).
## Further reading
- [{% data variables.product.prodname_dotcom %} Flavored Markdown Spec](https://github.github.com/gfm/)
- "[Basic writing and formatting syntax](/articles/basic-writing-and-formatting-syntax)"

View File

@@ -1,21 +0,0 @@
---
title: Working with advanced formatting
intro: 'Formatting like tables, syntax highlighting, and automatic linking allows you to arrange complex information clearly in your pull requests, issues, and comments.'
redirect_from:
- /articles/working-with-advanced-formatting
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
children:
- /organizing-information-with-tables
- /organizing-information-with-collapsed-sections
- /creating-and-highlighting-code-blocks
- /autolinked-references-and-urls
- /attaching-files
- /creating-a-permanent-link-to-a-code-snippet
- /using-keywords-in-issues-and-pull-requests
shortTitle: Work with advanced formatting
---

View File

@@ -1,42 +0,0 @@
---
title: Organizing information with collapsed sections
intro: 'You can streamline your Markdown by creating a collapsed section with the `<details>` tag.'
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
shortTitle: Collapsed sections
---
## Creating a collapsed section
You can temporarily obscure sections of your Markdown by creating a collapsed section that the reader can choose to expand. For example, when you want to include technical details in an issue comment that may not be relevant or interesting to every reader, you can put those details in a collapsed section.
Any Markdown within the `<details>` block will be collapsed until the reader clicks {% octicon "triangle-right" aria-label="The right triange icon" %} to expand the details. Within the `<details>` block, use the `<summary>` tag to create a label to the right of {% octicon "triangle-right" aria-label="The right triange icon" %}.
```markdown
<details><summary>CLICK ME</summary>
<p>
#### We can hide anything, even code!
```ruby
puts "Hello World"
```
</p>
</details>
```
The Markdown will be collapsed by default.
![Rendered collapsed](/assets/images/help/writing/collapsed-section-view.png)
After a reader clicks {% octicon "triangle-right" aria-label="The right triange icon" %}, the details are expanded.
![Rendered open](/assets/images/help/writing/open-collapsed-section.png)
## Further reading
- [{% data variables.product.prodname_dotcom %} Flavored Markdown Spec](https://github.github.com/gfm/)
- "[Basic writing and formatting syntax](/articles/basic-writing-and-formatting-syntax)"

View File

@@ -1,81 +0,0 @@
---
title: Organizing information with tables
intro: 'You can build tables to organize information in comments, issues, pull requests, and wikis.'
redirect_from:
- /articles/organizing-information-with-tables
- /github/writing-on-github/organizing-information-with-tables
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
shortTitle: Organized data with tables
---
## Creating a table
You can create tables with pipes `|` and hyphens `-`. Hyphens are used to create each column's header, while pipes separate each column. You must include a blank line before your table in order for it to correctly render.
```markdown
| First Header | Second Header |
| ------------- | ------------- |
| Content Cell | Content Cell |
| Content Cell | Content Cell |
```
![Rendered table](/assets/images/help/writing/table-basic-rendered.png)
The pipes on either end of the table are optional.
Cells can vary in width and do not need to be perfectly aligned within columns. There must be at least three hyphens in each column of the header row.
```markdown
| Command | Description |
| --- | --- |
| git status | List all new or modified files |
| git diff | Show file differences that haven't been staged |
```
![Rendered table with varied cell width](/assets/images/help/writing/table-varied-columns-rendered.png)
{% data reusables.user_settings.enabling-fixed-width-fonts %}
## Formatting content within your table
You can use [formatting](/articles/basic-writing-and-formatting-syntax) such as links, inline code blocks, and text styling within your table:
```markdown
| Command | Description |
| --- | --- |
| `git status` | List all *new or modified* files |
| `git diff` | Show file differences that **haven't been** staged |
```
![Rendered table with formatted text](/assets/images/help/writing/table-inline-formatting-rendered.png)
You can align text to the left, right, or center of a column by including colons `:` to the left, right, or on both sides of the hyphens within the header row.
```markdown
| Left-aligned | Center-aligned | Right-aligned |
| :--- | :---: | ---: |
| git status | git status | git status |
| git diff | git diff | git diff |
```
![Rendered table with left, center, and right text alignment](/assets/images/help/writing/table-aligned-text-rendered.png)
To include a pipe `|` as content within your cell, use a `\` before the pipe:
```markdown
| Name | Character |
| --- | --- |
| Backtick | ` |
| Pipe | \| |
```
![Rendered table with an escaped pipe](/assets/images/help/writing/table-escaped-character-rendered.png)
## Further reading
- [{% data variables.product.prodname_dotcom %} Flavored Markdown Spec](https://github.github.com/gfm/)
- "[Basic writing and formatting syntax](/articles/basic-writing-and-formatting-syntax)"

View File

@@ -1,32 +0,0 @@
---
title: Using keywords in issues and pull requests
intro: Use keywords to link an issue and pull request or to mark an issue or pull request as a duplicate.
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
topics:
- Issues
- Pull requests
---
## Linking a pull request to an issue
To link a pull request to an issue to{% ifversion fpt or ghes or ghae or ghec %} show that a fix is in progress and to{% endif %} automatically close the issue when someone merges the pull request, type one of the following keywords followed by a reference to the issue. For example, `Closes #10` or `Fixes octo-org/octo-repo#100`.
* close
* closes
* closed
* fix
* fixes
* fixed
* resolve
* resolves
* resolved
For more information, see "[Linking a pull request to an issue](/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue)."
## Marking an issue or pull request as a duplicate
To mark an issue or pull request as a duplicate, type "Duplicate of" followed by the issue or pull request number it duplicates in the body of a new comment. For more information, see "[Marking issues or pull requests as a duplicate](/issues/tracking-your-work-with-issues/marking-issues-or-pull-requests-as-a-duplicate)."

View File

@@ -1,28 +0,0 @@
---
title: About saved replies
intro: You can use a saved reply to respond to an issue or pull request.
redirect_from:
- /articles/about-saved-replies
- /github/writing-on-github/about-saved-replies
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
![Saved replies](/assets/images/help/settings/saved-replies.png)
Saved replies allow you to create a reusable response to issues and pull requests. Save time by creating a saved reply for the responses you use most frequently.
Once you've added a saved reply, it can be used in both issues and pull requests. Saved replies are tied to your user account. Once they're created, you'll be able to use them across repositories and organizations.
You can create a maximum of 100 saved replies. If you've reached the maximum limit, you can delete saved replies that you no longer use or edit existing saved replies.
You can also use the {% data variables.product.product_name %}-provided "Duplicate issue" saved reply to mark an issue as a duplicate and track it with a similar issue.
## Further reading
- "[Creating a saved reply](/articles/creating-a-saved-reply)"
- "[Using saved replies](/articles/using-saved-replies)"
- "[Editing a saved reply](/articles/editing-a-saved-reply)"
- "[Deleting a saved reply](/articles/deleting-a-saved-reply)"

View File

@@ -1,28 +0,0 @@
---
title: Creating a saved reply
intro: 'If you frequently add the same comment over and over, you can create a saved reply.'
redirect_from:
- /articles/creating-a-saved-reply
- /github/writing-on-github/creating-a-saved-reply
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
{% data reusables.user_settings.access_settings %}
{% data reusables.user_settings.saved_replies %}
3. Under "Add a saved reply", add your saved reply title.
![Saved reply title](/assets/images/help/settings/saved-replies-title.png)
4. In the "Write" field, add the content you'd like to use for the saved reply. For more information on writing on {% data variables.product.product_name %}, see "[Basic writing and formatting syntax](/articles/basic-writing-and-formatting-syntax)."
![Writing a saved reply](/assets/images/help/settings/saved-replies-settings-adding.png)
5. To review your reply, click **Preview**.
![Add a saved reply](/assets/images/help/settings/saved-replies-preview.png)
6. Click **Add saved reply**.
!["Add saved reply" button](/assets/images/help/settings/saved-replies-add-button.png)
## Further reading
- "[Using saved replies](/articles/using-saved-replies)"
- "[Editing a saved reply](/articles/editing-a-saved-reply)"
- "[Deleting a saved reply](/articles/deleting-a-saved-reply)"

View File

@@ -1,16 +0,0 @@
---
title: Deleting a saved reply
intro: 'If you find that you''re no longer using a saved reply, you can delete it.'
redirect_from:
- /articles/deleting-a-saved-reply
- /github/writing-on-github/deleting-a-saved-reply
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
{% data reusables.user_settings.access_settings %}
{% data reusables.user_settings.saved_replies %}
3. Under "Saved replies", next to the saved reply you want to delete, click {% octicon "x" aria-label="The X" %}.
![Delete saved reply](/assets/images/help/settings/saved-replies-delete-existing.png)

View File

@@ -1,27 +0,0 @@
---
title: Editing a saved reply
intro: You can edit the title and body of a saved reply.
redirect_from:
- /articles/changing-a-saved-reply
- /articles/editing-a-saved-reply
- /github/writing-on-github/editing-a-saved-reply
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
{% data reusables.user_settings.access_settings %}
{% data reusables.user_settings.saved_replies %}
3. Under "Saved replies", next to the saved reply you want to edit, click {% octicon "pencil" aria-label="The pencil" %}.
![Edit a saved reply](/assets/images/help/settings/saved-replies-edit-existing.png)
4. Under "Edit saved reply", you can edit the title and the content of the saved reply.
![Edit title and content](/assets/images/help/settings/saved-replies-edit-existing-content.png)
5. Click **Update saved reply**.
![Update saved reply](/assets/images/help/settings/saved-replies-save-edit.png)
## Further reading
- "[Creating a saved reply](/articles/creating-a-saved-reply)"
- "[Deleting a saved reply](/articles/deleting-a-saved-reply)"
- "[Using saved replies](/articles/using-saved-replies)"

View File

@@ -1,19 +0,0 @@
---
title: Working with saved replies
intro: 'To save time and make sure you''re delivering a consistent message, you can add saved replies to issue and pull request comments.'
redirect_from:
- /articles/working-with-saved-replies
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
children:
- /about-saved-replies
- /creating-a-saved-reply
- /editing-a-saved-reply
- /deleting-a-saved-reply
- /using-saved-replies
shortTitle: Work with saved replies
---

View File

@@ -1,33 +0,0 @@
---
title: Using saved replies
intro: 'When commenting on an issue or pull request, you can add a saved reply that you''ve already set up. The saved reply can be the entire comment or if you want to customize it, you can add or delete content.'
redirect_from:
- /articles/using-saved-replies
- /github/writing-on-github/using-saved-replies
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
---
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-issue-pr %}
2. Click the desired issue or pull request.
3. To add a saved reply, in the comment field, click {% octicon "reply" aria-label="The mail reply" %}.
![Saved replies button](/assets/images/help/writing/saved-replies-button.png)
4. From the list, select the saved reply you'd like to add to your comment.
![Saved replies](/assets/images/help/settings/saved-replies.png)
{% tip %}
**Tips:**
- You can use a keyboard shortcut to autofill the comment with a saved reply. For more information, see "[Keyboard shortcuts](/articles/keyboard-shortcuts/#comments)."
- You can filter the list by typing the title of the saved reply.
{% endtip %}
## Further reading
- "[Creating a saved reply](/articles/creating-a-saved-reply)"
- "[Editing a saved reply](/articles/editing-a-saved-reply)"
- "[Deleting a saved reply](/articles/deleting-a-saved-reply)"