Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

How to add vcs in intellij?

2 Answer(s) Available
Answer # 1 #
  • From the Android Studio VCS menu, select Enable Version Control Integration.
  • From the menu, select a VCS to associate with the project root.
  • Click OK.
[2]
Edit
Query
Report
Alaa Artz
Chief Customer Officer
Answer # 2 #

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.

To clone an existing Git repository −

Git will track the changes that you make in repository. Let us modify any file from the repository and compare it with the repository.

Follow these steps to discard the local changes −

To add file to repository navigate to VCS → Git → Add option. This action is similar to the git add action.

The Commit operation will create local commit. It is similar to the git commit action. To perform commit −

The Push action will send local changes to the remote repository. To push changes −

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 −

Follow these steps to fetch updates from the repository −

To add existing project under Git −

In this section, we will understand how Subversion works in IntelliJ. Let us consider a few important actions to understand this.

To checkout SVN repository −

SVN will track changes you made in the repository. Let us modify any file from repository and compare it with repository −

Follow these steps to revert the local changes you have made −

Follow these steps to commit changes in the remote repository −

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 −

To fetch latest changes navigate to VCS → Subversion → Update File/Update Folder option.

Follow these steps to add existing project under SVN −

[1]
Edit
Query
Report
mgbenk Iqbal
STACKER