unversioned files idea что это

Manage files under version control

Add files to VCS

Open the Commit tool window Alt+0

Put any files in the Unversioned Files changelist under version control by pressing Ctrl+Alt+A or selecting Add to VCS from the context menu. You can either add the entire changelist, or select separate files.

If you have enabled VCS integration for your project, IntelliJ IDEA suggests to add each newly created file under version control (you can change this behavior in the Settings/Preferences dialog Ctrl+Alt+S under Version Control | Confirmation ). If you want certain files to always remain unversioned, you can configure your VCS to ignore them.

You can also add files to your local repository from the Project tool window. Select the files you want to add, and press Ctrl+Alt+A or choose VCS | | Add from the context menu.

Check project files status

IntelliJ IDEA allows you to check the status of your local working copy compared to the repository version of the project. It lets you see which files have been modified, which new files have been added to the VCS, and which files are not being tracked by Git.

Open the Commit tool window Alt+0

unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    The Default changelist shows all files that have been modified since you last synchronized with the remote repository (highlighted in blue), and all new files that have been added to the VCS but have not been committed yet (highlighted in green).

    The Unversioned Files changelist shows all files that have been added to your project, but that are not being tracked by Git.

    Track changes to a file in the editor

    You can also track changes to a file as you modify it in the editor. All changes are highlighted with change markers that appear in the gutter next to the modified lines, and show the type of changes introduced since you last synchronized with the repository. When you commit changes to the repository, change markers disappear.

    The changes you introduce to the text are color-coded:

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что этоline added.

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что этоline changed.

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что этоline deleted.

    You can manage changes using a toolbar that appears when you hover the mouse cursor over a change marker and then click it. The toolbar is displayed together with a frame showing the previous contents of the modified line:

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    Instead of reverting the whole file, you can copy any part of the contents of this popup and paste it into the editor.

    Delete files from the repository

    If you delete a file that is under version control, it still exists in the repository until you’ve committed the changes. The deleted file is placed to the active changelist, and is highlighted with grey.

    In the dialog that opens, you can choose whether you want to delete this file without searching for usages, or to perform safe delete to make sure that you are deleting an unused file by checking the Safe delete option.

    If any usages have been found, the Usages Detected dialog will popup listing them. You can view these usages and remove references to this file before deleting it.

    Источник

    Создание локального репозитория git

    У вас есть проект и вы хотите сохранить его на GitHub. Рассмотрим как сделать это из среды разработки IntelliJ IDEA.

    В открывшемся окошке выбираем путь где хотим инициализировать репозиторий (можно оставить по умолчанию) и нажимаем кнопку Ok:

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    После того как будет создан локальный репозиторий, внизу появится меню Version Control. Если меню не появилось, выбираем View->Tool Windows->Version Control:

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    Шаг 2: добавим файлы под версионный контроль. В окошке Version Control нас интересует вкладка Local Changes. В списке Unversioned Files находятся файлы, которые не отслеживаются git. Intellij IDEA выделяет их коричневым:

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    Выберем файлы, изменения в которых мы хотим отслеживать, вызываем контекстное меню и нажимаем кнопку Add to VCS:

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    Обычно это только java файлы. Конфигурационные и class файлы не следует добавлять в репозиторий.

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    Если проект уже находится под версионным контролем, то при добавлении нового файла, Intellij IDEA предлагает добавить его сразу же под версионный контроль:

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    Шаг 3: Коммит файлов. Наконец вы хотите сохранить состояние своего проекта в репозиторий git. Для этого делаем так называемый коммит, который создает снимок состояния (snapshot) проекта в данный момент. Выбираем Default Changelist, вызываем контекстное меню и жмем Commit:

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    Состояние всех файлов, находящихся в Default Changelist сохраняется в снимке.

    При изменении файла, который уже был закомичен, он опять попадает в Default Changelist, но теперь будет синего цвета.

    Для того чтобы просмотреть все коммиты, перейдите во вкладку Log. Здесь можно увидеть всю информацию о сделанных коммитах: кто и когда сделал коммит, какие файлы были изменены.

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    Шаг 5: Операция push. После публикации репозитория на Github вы сделали изменения в своем локальном репозитории, и хотите эти изменения добавить на GitHub. Для этого используется операция push: VCS->Git->Push.

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    Шаг 6: Операция pull. Если изменения в вашем локальном репозитории устарели и вы хотите подтянуть изменения с GitHub, используйте операцию pull: VCS->Git->Pull.

    Источник

    В старых снимках (commits) видны добавленные позже файлы и подаются Гитом как «Unversioned Files»

    Позже заметил, что, откатившись к старым снимкам, я вижу в них как неотслеживаемые те файлы, которые были добавлены намного позже.

    Использую ИСР «PHPStorm».

    Как навести порядок, чтобы в старых снимках не отображались добавленные позже игнорируемые файлы? Или это нормальное поведение?

    1 ответ 1

    «Unversioned Files» означает «неотслеживаемые» или «неверсионируемые» файлы. Они принципиально не могут быть в коммите. В эту категорию Git (команда git status ) относит файлы, которые:

    Откуда могли появиться эти файлы

    Возможно несколько вариантов:

    Демонстрация

    Инициализируем репозиторий в новой папке

    В первый коммит сохраним файл а

    Во второй коммит сохраним файл b

    Создадим ещё один файл, но добавлять не будем

    Посмотрим на лог (у вас будут другие хеши)

    Посмотрим на состояние

    Видно, что файл c попал в категорию Untracked files. Он ещё ни разу не добавлялся в коммит.

    Теперь переключим репозиторий на предыдущий коммит, а рабочую область (файлы) оставим неизменной

    Как Git определяет untracked файлы

    Небольшой экскурс в анатомию для тех, кому интересно.

    Каждый коммит хранит информацию о дереве файлов и папок, которые в этом коммите сохранены. Для каждого файла есть ссылка на архив с его содержимым. Посмотреть можно так:

    Возьмем хеш из tree, убедимся что этот объект действительно дерево:

    Видно, что там тот же файл — значит новых файлов в индекс не добавляли. У файла тот же хеш — новых версий этого файла тоже не добавляли.

    Источник

    Set up a Git repository

    When you clone an existing Git repository, or put an existing project under Git version control, IntelliJ IDEA automatically detects if Git is installed on your computer. If the IDE can’t locate a Git executable, it suggests downloading it.

    IntelliJ IDEA supports Git from the Windows Subsystem for Linux 2 (WSL2), which is available in Windows 10 version 2004.

    If Git is not installed on Windows, IntelliJ IDEA searches for Git in WSL and uses it from there. Also, IntelliJ IDEA automatically switches to Git from WSL for projects that are opened when you use the \\wsl$ path.

    Check out a project from a remote host (clone)

    IntelliJ IDEA allows you to check out (in Git terms clone ) an existing repository and create a new project based on the data you’ve downloaded.

    In the Get from Version Control dialog, specify the URL of the remote repository you want to clone, or select one of the VCS hosting services on the left.

    If you are already logged in to the selected hosting service, completion will suggest the list of available repositories that you can clone.

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    If your project contains submodules, they will also be cloned and automatically registered as project roots.

    When you import or clone a project for the first time, IntelliJ IDEA analyzes it. If the IDE detects more than one configuration (for example, Eclipse and Gradle), it prompts you to select which configuration you want to use.

    If the project that you are importing uses a build tool, such as Maven or Gradle, we recommend that you select the build tool configuration.

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    Put an existing project under Git version control

    You can create a local Git repository based on an existing project sources.

    Associate the entire project with a single Git repository

    Open the project that you want to put under Git.

    Choose Enable Version Control Integration from the VCS Operations Popup Alt+` or from the main VCS menu.

    After VCS integration is enabled, IntelliJ IDEA will ask you whether you want to share project settings files via VCS. You can choose Always Add to synchronize project settings with other repository users who work with IntelliJ IDEA.

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

    Associate different directories within the project with different Git repositories

    Open the project that you want to put under Git.

    In the dialog that opens, specify the directory where a new Git repository will be created.

    Git does not support external paths, so if you choose a directory that is outside your project root, make sure that the folder where the repository is going to be created also contains the project root.

    If you are creating multiple Git repositories inside the project structure, repeat the previous steps for each directory.

    After you have initialized a Git repository for your project, you need to add project files to the repository.

    Add files to the local repository

    Select the files you want to add to Git or the entire changelist and press Ctrl+Alt+A or choose Add to VCS from the context menu.

    You can also add files to your local Git repository from the Project tool window: select the files you want to add, and press Ctrl+Alt+A or choose Git | Add from the context menu.

    Exclude files from version control (ignore)

    Sometimes you may need to leave certain files unversioned. These can be VCS administration files, artifacts of utilities, backup copies, and so on. You can ignore files through IntelliJ IDEA, and the IDE will not suggest adding them to Git and will highlight them as ignored.

    Git lets you list ignored file patterns in two kinds of configuration files:

    Patterns listed in this file only apply to the local copy of the repository.

    This file is created automatically when you initialize or check out a Git repository.

    These files are checked into the repository so that the ignore patterns in them are available to the entire team. Therefore, it is a most common place to store the ignored file patterns.

    Locate the unversioned file or folder you want to ignore in the Local Changes view or in Project tool window. File colors in these views help you identify the status of the file.

    File colors in these views help you identify the status of the file.

    Check project status

    IntelliJ IDEA allows you to check the status of your local working copy compared to the repository version of the project. It uses specific colors to let you see which files have been modified, which new files have been added to the VCS, and which files are not being tracked by Git.

    Open the Local Changes view.

    unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

      The Default changelist shows all files that have been modified since you last synchronized with the remote repository (highlighted in blue), and all new files that have been added to the VCS but have not been committed yet (highlighted in green).

      The Unversioned Files changelist shows all files that have been added to your project, but that are not being tracked by Git.

      Track changes to a file in the editor

      You can also track changes to a file as you modify it in the editor. All changes are highlighted with change markers that appear in the gutter next to the modified lines, and show the type of changes introduced since you last synchronized with the repository. When you commit changes to the repository, change markers disappear.

      The changes you introduce to the text are color-coded:

      unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что этоline added.

      unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что этоline changed.

      unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что этоline deleted.

      You can manage changes using a toolbar that appears when you hover the mouse cursor over a change marker and then click it. The toolbar is displayed together with a frame showing the previous contents of the modified line:

      unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

      Instead of reverting the whole file, you can copy any part of the contents of this popup and paste it into the editor.

      Add a remote repository

      If you created a Git repository based on local sources, you need to add a remote repository to be able to collaborate on your Git project, as well as to eliminate the risks of storing all of your codebase locally. You push changes to a remote repository when you need to share your work and pull data from it to integrate changes made by other contributors into your local repository version.

      For information on how to share project settings for different project formats, see Share project settings through VCS.

      Define a remote

      Create an empty repository on any Git hosting, such as Bitbucket or GitHub. You can create a repository on GitHub without leaving IntelliJ IDEA: see Share a project on GitHub.

      If you haven’t added any remotes so far, the Define remote link will appear instead of a remote name. Click it to add a remote.

      Add a second remote

      In some cases, you also need to add a second remote repository. This may be useful, for example, if you have cloned a repository that you do not have write access to, and you are going to push changes to your own fork of the original project. Another common scenario is that you have cloned your own repository that is somebody else’s project fork, and you need to synchronize with the original project and fetch changes from it.

      To edit a remote (for example, to change the name of the original project that you have cloned), right-click the remote branch in the Branches pane of the Git Log tool window, and select Edit Remote from the context menu.

      You can also edit a remote from the Push Dialog by clicking its name.

      To remove a repository that is no longer valid, right-click it in the Branches pane of the Git Log tool window, and select Remove Remote from the context menu.

      Источник

      IntelliJ Show Diff Includes Unversioned Files

      After upgrading to IntelliJ IDEA 2021.2.2 Ultimate Edition, I’ve noticed now that when I go to the Commit pane and select Show Diff on a file in the Default Changelist, that it includes the Unversioned Files in the set of files for the diff comparison.

      Is this a new feature? It seems like a bug to me. I can’t seem to find any documentation for it. I can’t find any way to turn it off.

      I see there is a «Show unversioned files» check box in the Version Control > Commit section of Preferences, but clicking it doesn’t seem to change anything. unversioned files idea что это. Смотреть фото unversioned files idea что это. Смотреть картинку unversioned files idea что это. Картинка про unversioned files idea что это. Фото unversioned files idea что это

      1 Answer 1

      New commit tool: don’t jump to other changelist’s changes

      I always review all changes on the current changelist before commit. I focus the diff preview and use F7 to jump through all changes on all files. Previously, when I reached the last file F7 stopped jumping to other files. But after enabling the new tool, when I press F7 on the last changed file on the current changelist, it jumps to the first change on the next changelist. That’s a problem since I can begin reviewing changes which are not intended for commiting right now, loosing time, confusing me and even risking to mix files from different changesets.

      I had failed to find that issue on https://youtrack.jetbrains.com because I hadn’t yet tried having files in source control with changes in a non-default change list. I was only searching YouTrack for the fact that Show Diff now includes un-versioned files.

      So, it seems that if you choose Show Diff from a file in a change list, then the diff comparison tool will now include all files in the set of files, regardless which change list they are in and regardless whether they are in source control yet.

      I think that this is a bug and have voted for the issue. I encourage others to do so as well.

      Источник

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

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