Skip to main content

Эта версия GitHub Enterprise Server была прекращена 2024-09-25. Исправления выпускаться не будут даже при критических проблемах безопасности. Для повышения производительности, повышения безопасности и новых функций выполните обновление до последней версии GitHub Enterprise Server. Чтобы получить справку по обновлению, обратитесь в службу поддержки GitHub Enterprise.

Создание новых файлов

Вы можете создавать новые файлы непосредственно в GitHub Enterprise Server в любом репозитории, для которого у вас есть доступ на запись.

When creating a file on GitHub Enterprise Server, consider the following:

Warning

Never git add, commit, or push sensitive information, for example passwords or API keys, to a remote repository. If you've already added this information, see Removing sensitive data from a repository.

  1. On GitHub, navigate to the main page of the repository.

  2. In your repository, browse to the folder where you want to create a file.

  3. Above the list of files, using the Add file drop-down, click Create new file.

  4. In the file name field, type the name and extension for the file. To create subdirectories, type the / directory separator.

  5. In the file contents text box, type content for the file.

  6. To review the new content, above the file contents, click Preview.

    Screenshot of a file in edit mode. Above the text box for editing file contents, a tab, labeled "Preview", outlined in dark orange.

  7. In the "Commit message" field, type a short, meaningful commit message that describes the change you made to the file. You can attribute the commit to more than one author in the commit message. For more information, see Creating a commit with multiple authors.

  8. Below the commit message fields, decide whether to add your commit to the current branch or to a new branch. If your current branch is the default branch, you should choose to create a new branch for your commit and then create a pull request. For more information, see Creating a pull request.

    Screenshot of a GitHub pull request showing a radio button to commit directly to the main branch or to create a new branch. New branch is selected.

  9. Click Commit changes or Propose changes.