update project idea что делает
IntelliJ supports various version control systems like Git, Subversion, Mercurial, CVS, GitHub and TFS. You can perform version control related action from the IDE itself.
In this chapter, we will discuss Git and Subversion (hereafter referred to as SVN). We assume that the reader is familiar with Git and SVN tool and its terminology.
In this section, we will learn how to work with Git.
Clone
To clone an existing Git repository −
Navigate to File->New->Project from Version Control->Git.
Enter the repository URL, Parent directory and Directory name.
Click on the clone button to continue.
Upon successful running of the above steps, the repository will get cloned.
Track changes
Git will track the changes that you make in repository. Let us modify any file from the repository and compare it with the repository.
Navigate to VCS → Git → Compare with Latest Repository Version.
The above step will open the diff window.
You can see there is a new line on the right side with green background colour.
Git shows it in green as we have added new contents. If we remove any contents then it’ll be shown in red colour
Revert local changes
Follow these steps to discard the local changes −
Navigate to the VCS → Git → Revert option.
It will ask for confirmation and remove your changes.
Add file to repository
To add file to repository navigate to VCS → Git → Add option. This action is similar to the git add action.
Commit changes
The Commit operation will create local commit. It is similar to the git commit action. To perform commit −
Navigate to the VCS → Git → Commit File option.
Select files to be committed.
Enter commit message and click on Commit button.
Push changes to the remote repository
The Push action will send local changes to the remote repository. To push changes −
Navigate to the VCS → Git → Push option.
A window will appear. Here, you can see the comitts to be pushed.
Verify commit and click on the Push button to publish your changes.
View history or logs
To show history, navigate to the VCS → Git → Show history option. This action is similar to the git log command. It will show history as follows −
Get updates
Follow these steps to fetch updates from the repository −
Navigate to the VCS → Git → Pull option.
Select the option according to your requirements.
Click on the Pull button.
Add existing project to Git
To add existing project under Git −
Navigate to VCS → Import into Version Control → Create Git repository.
Select project by browsing directory.
Click on the OK button.
Subversion
In this section, we will understand how Subversion works in IntelliJ. Let us consider a few important actions to understand this.
Checkout
To checkout SVN repository −
Navigate to File → New → Project from Version Control → Subversion.
Enter repository URL.
Click on the OK button.
Track changes
SVN will track changes you made in the repository. Let us modify any file from repository and compare it with repository −
Navigate to VCS->Subversion->Compare with Latest Repository Version
You can see there is new line on right side with green background colour.
SVN shows it in with green background to indicated the addition of new content. If we remove any content then it will be shown in red colour.
Revert local changes
Follow these steps to revert the local changes you have made −
Navigate to the VCS → Subversion → Revert option.
It will ask for confirmation and remove your changes.
Commit changes to remote repository
Follow these steps to commit changes in the remote repository −
Navigate to VCS → Subversion → Commit Files option.
A new window will appear. Here, you can see the files to be committed to remote respository.
Verify the files and click on the Commit button to publish your changes.
View history or logs
To show history, navigate to the VCS → Subverion → Show history option. This option is similar to the svn log command. It will show history as follows −
Update operation
To fetch latest changes navigate to VCS → Subversion → Update File/Update Folder option.
Add existing project to Subversion
Follow these steps to add existing project under SVN −
Navigate to VCS → Import into Version Control → Import into Subverion.
Enter the repository URL and click on the Import button −
Руководство пользователя IntelliJ IDEA. Основы работы с системами контроля версий
Основы работы с системами контроля версий
Получить ваш проект из системы контроля версий
Чтобы импортировать ваш проект из системы контроля версий, нажмите кнопку Check out from Version Control на Welcome screen (приветственное окно IDEA), или в меню VCS (система контроля версий) на главной панели меню.
Если в вашем проекте есть файлы настройки сборки для Maven или Gradle, IntelliJ IDEA предложит вам использовать их для конфигурации.
Настройки системы контроля версий
Настройки системы контроля версий вашего проекта доступны в меню Settings → Version Control. Вы можете выбрать любую из директорий вашего проекта в качестве корневой для используемой вами системы контроля версий, а также поменять этот выбор в любое время. Также вы можете в любой момент отключить контроль версий.
Также, вы можете разные директории вашего проекта хранить в разных системах контроля версий, IntelliJ IDEA позволяет вам проводить все операции над ними одинаково.
Окно инструментов «изменения» и списки изменений
После того как вы подключили систему контроля версий на вашем проекте, вы можете видеть и управлять локальными изменениями с помощью окна инструментов Changes. Чтобы быстро его открыть, нажмите Alt + 9 (Cmd + 9 для Mac).
Чтобы упростить управление изменениями, все они организованы в списки изменений которые вы можете создавать, удалять и делать активными.
Всплывающее меню операций системы контроля версий
Если вам нужно запустить какую-то операцию системы контроля версий для выделенного файла, директории или даже для всего проекта, используйте всплывающее меню VCS operations по сочетанию клавиш Alt + Back Quote (одиночная левая кавычка, символ ‘) (Ctrl + V для Mac).
Отображение истории изменений
История изменений для файлов или директорий вашего проекта доступна из меню VCS operations, или из главной панели меню VCS → → Show History, или из контекстного меню → Show History.
Чтобы посмотреть изменения для конкретного фрагмента кода, используйте пункт Show History for Selection.
Аннотации
Аннтоации доступны как из всплывающего меню, так и из главного и контекстного меню. Они позволяют вам видеть кто и когда поменял каждую конкретную строку кода.
Вызвав панель аннотаций, вы увидете детальную информацию о соответствующем коммите.
Полезные клавиатурные сочетания
Варианты сохранения изменений
Когда вы добавляете ваши изменения в систему контроля версий, IntelliJ IDEA позволяет вам производить самые разные операции: поменять список изменений в который вы их добавляете, объеденить изменения с уже добавленными, используя Amend commit, переформатировать измененный код, оптимизировать импорты, убедиться что инспекция кода не выдает никаких предупреждений, обновить информацию о копирайте, или даже загрузить ваши изменения на удаленный ftp сервер.
Игнорируемые файлы
Настроить список игнорируемых файлов можно в меню Settings → Version Control, или с помощью соответствующей кнопки в окне инструментов Changes.
Текущий список игнорируемых файлов можно увидеть в окне инструментов Changes рядом со списками изменений, нажав соответствующую кнопку.
Ветви
С помощью IntelliJ IDEA вы можете легко создавать, переключаться, объединять, сравнивать и удалять ветви кода. (только в Git и Mercurial). Чтобы посмотреть список существующих ветвей или создать новую, используйте либо Branches из главного или контекстного меню, или всплывающее меню VCS operations, или элемент управления на правой стороне панели статуса.
Для разных систем контроля версий IntelliJ IDEA производит все операции одновременно, так что вы не должны переключаться между ними.
Shelves, stashes, и patches
Меню Shelves и Stashes помогает вам спрятать некоторые локальные изменения без добавления их в систему контроля версий. Нужно это для того, чтобы переключиться на ту версию файлов что хранится в системе контроля версий и потом иметь возможность вернуться назад к вашим локальным изменениям. Различаются они тем, что Shelves поддерживается самой IntelliJ IDEA и хранятся они локально у вас, а Stashes хранятся в системе контроля версий. Patches позволяет вам сохранить некоторый набор изменений в виде файла, который можно передать по электронной почте или выложить на общедоступный диск и потом применить к коду. Это полезно если вы работаете удаленно, без постоянного подключения к системе контроля версий, но все равно должны передавать ваши изменения другим членам проекта.
Чтобы посмотреть полный список изменений, добавленных в систему контроля версий, отсортированный и отфильтрованый по ветви кода, имени пользователя, дате, папке или даже фразе в описании, откройте вкладку Log в окне инструментов Changes. Это простейший способ найти нужный вам набор изменений, или изучить историю изменений.
Оригинал статьи
Update Project dialog (Subversion)
Use this dialog to update the local working copy of a file, directory, or project with a revision from the repository.
Update/Switch to specific Url
Select this checkbox to synchronize your local working copy with a specific repository. Specify the source repository either in the URL field through its full Url address or in the Use Branch field through the branch name.
Clear this checkbox to bring the changes from the repository that corresponds to the current working copy.
To use this method of specifying the required repository, you need to configure a list of branches you work with. If you have not done it yet, click Configure Branches in the Select Branch dialog.
The field is enabled only when the Update/Switch to specific Url checkbox is selected.
The field is enabled only when the Update/Switch to specific Url checkbox is selected.
Update/Switch to specific revision
Select this checkbox to synchronize your local working copy with a specific revision different from the HEAD revision. The Update/Switch to specific revision field becomes enabled.
Use this list to specify the range of recursion into subdirectories. The available options are:
Empty: select this option to involve only the current file.
Files: select this option to involve the files in the folder.
Immediates: select this option to involve direct children of the current file.
Infinity: select this option to enable full recursion.
Select this checkbox to have local files replaced with the files from the repository even if the local files have modifications and thus abandon the local modifications.
Select this checkbox if you do not want IntelliJ IDEA take into account externals definitions during update.
Do not show this dialog in the future
Select this checkbox to have IntelliJ IDEA perform future updates silently.
To have IntelliJ IDEA show this dialog before update again:
In the Display Option dialogs when these commands are invoked area, select the Update checkbox.
Подружим Git с Intellij IDEA
Необходимые вводные:
Клонируем проект локально
Копируем адрес проекта:
Открываем Intellij IDEA и выбираем Get from Version Control:
Копируем вставляем адрес на проект:
Вам предложат создать Intellij IDEA проект. Принимаем предложение:
Так как нет системы сборки, и это не входит в задачу статьи, выбираем Create project from existing sources:
Далее будет такая картина маслом: С клонированием разобрались, теперь-то можно и оглянуться по сторонам.
Первый взгляд на Intellij IDEA как на гит UI
Работа с репозиторием
Полезные горячие клавиши
Что мы хотим?
Получить все изменения на текущий момент в основной ветке (master, например).
На базе этой основной создать отдельную для своей работы.
Реализовать новую функциональность.
Перейти на основную ветку и проверить, не было ли новых изменений за время, пока работали. Если не было, то все хорошо, а если было, то делаем следующее: переходим на работающую ветку и делаем ребейз изменений из основной ветки в нашу. Если все прошло успешно, то отлично. Но вполне могут быть и конфликты. И их как раз можно будет заранее решить, не тратя время на удаленном репозитории.
Казалось бы, зачем это делать? Это правило хорошего тона, которое предотвращает возникновение конфликтов уже после пуша своей ветки на локальный репозиторий (есть, конечно, вероятность,что все равно они будут, но она становится значительно меньше).
Получить изменения с удаленного сервера?
Создать новую ветку на основе master
Переходим в правый нижний угол и нажимаем на Git: master, выбираем + New Branch.
Оставляем галочку Checkout branch и пишем имя новой ветки. Для меня это будет readme-improver.
После этого Git: master сменится на Git: readme-improver.
Update IntelliJ IDEA
By default, IntelliJ IDEA is configured to check for updates automatically and notify you when a new version is available. Updates are usually patch-based : they are applied to the existing installation and only require you to restart the IDE. However, sometimes patch updates are not available, and a new version of IntelliJ IDEA must be installed.
If IntelliJ IDEA does not have HTTP access outside your local network, it will not be able to check for updates and apply patches. In this case, you have to download new versions of the IDE and install them manually as described in Standalone installation.
Toolbox App
If you installed IntelliJ IDEA using the Toolbox App, it will suggest you to update the IDE when a new version is available.
Automatically update all managed tools
If you disable this option, you will need to click Update next to any instance when a newer version comes out.
You can also configure the update policy for every managed IDE instance separately.
Configure the update policy for a specific instance
In the instance settings dialog, select the update channel to use for this IDE instance:
Update to Release : Update only to stable releases that are recommended for production.
To Release and Early Access Program : Includes updates to release candidates, beta releases, and EAP builds, which are not recommended for production and include feature previews.
Standalone instance
If you installed IntelliJ IDEA manually, the standalone IDE instance will manage its own updates. It will notify you when a new version is available. You can choose to update the current instance, download and install the new version as a separate instance, postpone the notification, or ignore the update entirely.
Configure the update policy
If the IDE instance is managed by the Toolbox App, these settings will affect only plugin updates.
The Updates page contains the following settings:
Check IDE updates for
Select whether you want IntelliJ IDEA to check for updates automatically and choose an update channel.
Early Access Program : Provides all updates, including major version EAP builds and minor version Preview builds. This channel is not recommended for production development.
EAP versions can be updated to both newer EAP and stable IntelliJ IDEA versions. If an EAP version is updated to a stable version at some point, the name of the original installation directory does not change.
Beta Releases or Public Previews : Includes stable releases, release candidates, and beta releases. Some updates in this channel may contain minor bugs and feature previews.
Stable Releases : Includes only stable releases that are recommended for production.
Check for plugin updates
Select whether you want IntelliJ IDEA to check for new versions of plugins automatically.
Check for updates immediately.
Alternatively, from the main menu, select Help | Check for Updates on Windows or Linux, or IntelliJ IDEA | Check for Updates on macOS.
Manage ignored updates
Show the list of updates that were ignored. These updates will not be suggested until you remove them from the list of ignored updates.
If you remove several updates from the ignored list, only the most recent will be offered for download when you check for updates.
Show What’s New in the editor after an IDE update
Open a tab with information about new features and improvements after a major IDE update.
Snap package
If you installed IntelliJ IDEA as a snap package, it will manage updates automatically. All snaps are updated automatically in the background every day. You can also get the latest version of all snaps manually at any time by running the following command:
Or if you want to update only the IntelliJ IDEA snap: