Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.


In our daily work, when we change devices or reinstall systems, we often need to synchronize our previous code. At this time we are often using THE WAY of U disk copy, but this is very troublesome, there is no need to copy the media such as U disk can be achieved. Today we will look at how to use IDEA + Github to achieve cross-platform synchronization across devices. The following steps are based on installing Git and having a Github account. If you haven’t installed Git or don’t have a Github account, go ahead and install Git and apply for a Github account.

The synchronization process

Create a New Java project

  1. Create a new project, if there is a previous project, you can also directly open, do not need to create, and then directly skip to the next section;

  1. Select whether to create a project based on the template. By default, we do not select this option and go to the next step to create an empty project.

  1. Customize the project name and storage path, specify our project name here, and specify the project storage address;

Git & Github Settings

  1. If you want to set the Git installation path, IDEA will automatically detect your Git installation path. If you do not automatically detect Git installation path, you need to find Git installation path.

  1. After setting the Git installation path, we can directly log in to Github, here directly enter your Github account and password;

  1. After you click login, if the interface shown in the picture below shows your Github account profile picture and user name, it means that you have logged in successfully.

Push local items to remote

  1. In turn intoVCS -> Share Project on Github;

  1. Then fill in the warehouse name, remote branch, warehouse description, select private or not, and clickShareCan;

  1. After a while, IDEA will specify the following window to pop up. Here is mainly for us to select the file to be pushed to the remote, and submit information, after confirming both, finally clickAddCan;

  1. Wait for completion;

  1. If push fails due to network problems or other problems, you can click the button in the picture below and submit push again.

  1. Finally, click on the bottom toolbar of IDEAGitYou can view our submission record;

  1. Finally, go to Github to check whether the push was successful;

Commit and pull


When we make changes to our project, if we want to push our changes to the remote, we can do so through the following process.

  1. Click the button shown below (or use the shortcut key)Ctrl + K), then select our changes on the left and fill in the submission information, then click belowCommitCan;

  1. Then repeat step 5 in the previous section!
  2. Finally, go to our remote to see the content of the changes we just committed.


Suppose we submit our newly added function code on the company’s computer, and then we want to use our own computer to continue development. At this moment, the code on our own computer is still the old version, so we need to pull the newly added content from the company remotely first.

In this case, perform the following operations:

  1. Click the button in the picture below and choose according to your needsMergeorRebase;

  1. Then wait for the project update to complete.


Through the above operations, you can connect IntelliJ IDEA with remote Github, and push our work to Github at any time to save, no longer need to worry about migration between different devices, anytime and anywhere development ~

Finally, writing is not easy, if you think it helps you, then click “like” and go!