Как переименовать файл в github
Перейти к содержимому

Как переименовать файл в github

  • автор:

Переименование репозитория

Вы можете переименовать любой репозиторий, если вы являетесь владельцем организации или имеете права администратора для репозитория.

When you rename a repository, all existing information, with the exception of project site URLs, is automatically redirected to the new name, including:

For more information on project sites, see «About GitHub Pages.»

In addition to redirecting web traffic, all git clone , git fetch , or git push operations targeting the previous location will continue to function as if made on the new location. However, to reduce confusion, we strongly recommend updating any existing local clones to point to the new repository URL. You can do this by using git remote on the command line:

git remote set-url origin NEW_URL 

If you plan to rename a repository that has a GitHub Pages site, we recommend using a custom domain for your site. This ensures that the site’s URL isn’t impacted by renaming the repository. For more information, see «About custom domains and GitHub Pages.»

Note: GitHub will not redirect calls to an action hosted by a renamed repository. Any workflow that uses that action will fail with the error repository not found . Instead, create a new repository and action with the new name and archive the old repository. For more information, see «Archiving repositories.»

Warning: If you create a new repository under your account in the future, do not reuse the original name of the renamed repository. If you do, redirects to the renamed repository will no longer work.

  1. On GitHub.com, navigate to the main page of the repository.
  2. Under your repository name, click

Settings. If you cannot see the «Settings» tab, select the

Screenshot of a repository header showing the tabs. The

dropdown menu, then click Settings.

Перемещение и переименование файлов в GitHub

С сегодняшнего дня вы можете перемещать и переименовывать файлы в репозиториях, прямо из веб интерфейса GitHub.

Переименование файлов

Теперь при редактировании файла можно указать новое имя.

Но давайте посмотрим, что можно делать еще.

Перемещать файлы в новое место

Вы также можете перемещать файлы в совершенно новое место просто используя поле имени файла. Чтобы переместиться вниз по каталогу, просто введите название папки и / . Вы можете указать уже существующую папку, или выбрать совершенно новую!

Нет ничего проще, чем переместить файл выше по каталогу. Чтобы это сделать поместите курсор в начало имени файла

  • Введите ../ чтобы переместиться вверх
  • Нажмите backspace чтобы переместиться вверх по каталогу, при этом сохранив текущее местоположение, чтобы быстрее изменить расположение.
Создание файлов с произвольным положением

Данная функциональность также доступна при создании файлов, и это означает, что вы можете создавать файлы в любом месте вашего репозитория, даже если папка еще не существует!

Как мне изменить имена папок в гит? (с больших букв на маленькие)

Недавно начал осваивать гит. Когда я делал первый пуш в репозиторий на гитхабе, случайно назвал директории с большой буквы. Хотел поменять регистр первых букв в папках, но команда git add * почему-то отказывается распознавать регистр и пушит всё как и раньше с большой буквы, либо же вообще говорит что изменений никаких не было. Как это исправить? Можно ли напрямую как-нибудь переименовать папки в репозитории? Регистр здесь важен т.к. все эти директории являются пакетами и при импорте интерпретатор может просто напросто их не увидеть.

Отслеживать

13.7k 12 12 золотых знаков 43 43 серебряных знака 75 75 бронзовых знаков

Изменение файлов

Вы можете редактировать файлы непосредственно в GitHub в любом репозитории с помощью редактора файлов.

Editing files in your repository

Tip: If a repository has any protected branches, you can’t edit or upload files in the protected branch using GitHub. For more information, see «About protected branches.»

You can use GitHub Desktop to move your changes to a new branch and commit them. For more information, see «Committing and reviewing changes to your project in GitHub Desktop.»

Note: GitHub’s file editor uses CodeMirror.

  1. In your repository, browse to the file you want to edit.
  2. In the upper right corner of the file view, click

Screenshot of a file. In the header, a button, labeled with a pencil icon, is outlined in dark orange.

to open the file editor.

Note: Instead of editing and committing the file using the default file editor, you can optionally choose to use the github.dev code editor by selecting the

Screenshot of a file. In the header, a downwards-facing triangle icon is outlined in dark orange.

dropdown menu and clicking github.dev. You can also clone the repository and edit the file locally via GitHub Desktop by clicking GitHub Desktop.

Screenshot of a file in edit mode. Above the file's contents, a tab labeled

  • In the text box, make any changes you need to the file.
  • Above the new content, click Preview.

    Screenshot of a GitHub pull request showing a dropdown menu with options to choose the commit author email address. octocat@github.com is selected.

  • Click Commit changes.
  • 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.»
  • If you have more than one email address associated with your account on GitHub.com, click the email address drop-down menu and select the email address to use as the Git author email address. Only verified email addresses appear in this drop-down menu. If you enabled email address privacy, then a no-reply will be the default commit author email address. For more information about the exact form the no-reply email address can take, see «Setting your commit email address.»

    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.

    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.»

    Editing files in another user’s repository

    When you edit a file in another user’s repository, we’ll automatically fork the repository and open a pull request for you.

    1. In another user’s repository, browse to the folder that contains the file you want to edit. Click the name of the file you want to edit.
    2. Above the file content, click

    Screenshot of a file in edit mode. Above the file's contents, a tab labeled

    . At this point, GitHub forks the repository for you.

  • In the text box, make any changes you need to the file.
  • Above the new content, click Preview.

    Screenshot of a GitHub pull request showing a dropdown menu with options to choose the commit author email address. octocat@github.com is selected.

  • Click Commit changes.
  • 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.»
  • If you have more than one email address associated with your account on GitHub.com, click the email address drop-down menu and select the email address to use as the Git author email address. Only verified email addresses appear in this drop-down menu. If you enabled email address privacy, then a no-reply will be the default commit author email address. For more information about the exact form the no-reply email address can take, see «Setting your commit email address.»

  • Добавить комментарий

    Ваш адрес email не будет опубликован. Обязательные поля помечены *