Git, GitHub and gitee are used in idea to submit projects

Time:2021-10-9

1、 Git

Git is a distributed version control system, which can be used to realize team code version control and management

1. Download and install Git

Git download address
Git, GitHub and gitee are used in idea to submit projects
After git download is completed, install it as a fool (continue to the next step). Do not change the installation directory (if it has been installed, it does not need to be installed).

2. Git global configuration

Right click on the desktopGit Bash Here, open the GIT client tool

Git, GitHub and gitee are used in idea to submit projects
Git, GitHub and gitee are used in idea to submit projects

Configure the user name to identify the user who submitted the code

$git config -- global user.name "registered name"

Git, GitHub and gitee are used in idea to submit projects

Configure the mailbox to identify the user who submitted the code

$git config -- global user.email "registered mailbox"

Git, GitHub and gitee are used in idea to submit projects

Check configuration information

$ git config --list
[email protected]
user.name=xxxxxx

3. Check git configuration in idea
Git, GitHub and gitee are used in idea to submit projects

3. Create local library in idea project

VCS -> import into Version Control -> Create Git Repository

Git, GitHub and gitee are used in idea to submit projects

Local libraries are generally placed in the root directory of the project

Git, GitHub and gitee are used in idea to submit projects

After the local library is created, a file will be generated in the root directory of the project.gitDirectory (possibly hidden directory), and there will be obvious discoloration in the project structure

Git, GitHub and gitee are used in idea to submit projects
Git, GitHub and gitee are used in idea to submit projects

4. Configuration of GIT local library in the project

yes.gitDirectoryinfoIn the directoryexcludeThe file is configured to filter the specified resources (for example, which resources are not submitted and uploaded, this file can be globally configured). The contents are as follows:

5. Add the project to the GIT local library

Add project module to project moduleaddTo staging area, submitcommitTo local library

Git, GitHub and gitee are used in idea to submit projects

Right click in the project – > git – > Add (add to staging area)
And there will be obvious discoloration in the project structure

Git, GitHub and gitee are used in idea to submit projects

Right click in the project – > git – > commit directory (submit to local library)

Git, GitHub and gitee are used in idea to submit projects

2、 GitHub

1. Log in to GitHub’s official website to register or log in

GitHub official website
Git, GitHub and gitee are used in idea to submit projects

2. Create GitHub remote warehouse

Git, GitHub and gitee are used in idea to submit projects
Git, GitHub and gitee are used in idea to submit projects

3. Push the files in the local library to GitHub remote warehouse

Git, GitHub and gitee are used in idea to submit projects
Git, GitHub and gitee are used in idea to submit projects
Git, GitHub and gitee are used in idea to submit projects
Git, GitHub and gitee are used in idea to submit projects
Git, GitHub and gitee are used in idea to submit projects

3. Pull the project from GitHub remote warehouse

Git, GitHub and gitee are used in idea to submit projects
Git, GitHub and gitee are used in idea to submit projects
Git, GitHub and gitee are used in idea to submit projects

Common remote warehouses: GitHub, code cloud gitee, LAN self built git server. This paper takes GitHub as an example

3、 Gitee

1. Log in to gitee’s official website to register or log in

Gitee official website
Git, GitHub and gitee are used in idea to submit projects
Git, GitHub and gitee are used in idea to submit projects
Git, GitHub and gitee are used in idea to submit projects

2. Download gitee plug-in from idea

Settings -> Plugins -> Marketplace->FindGitee,installdownload

Git, GitHub and gitee are used in idea to submit projects

RestartRestart the idea so that the plug-in can be used in the idea

Git, GitHub and gitee are used in idea to submit projects

In the gitee configuration interface, click+The login interface will pop up and log in to the gitee account (please use the bound email to log in when logging in the account)

Git, GitHub and gitee are used in idea to submit projects

After successful login, the corresponding account information will be displayed

Git, GitHub and gitee are used in idea to submit projects

3. Push the project to gitee remote warehouse

The premise of gitee remote code hosting platform that pushes projects and files is that you have added (added to the staging area) and committed (submitted to the local library);
There are two situations:
One is that there is no remote warehouse you want to submit on gitee. Create a remote warehouse through gitee plug-in and push projects and filesPushTo the remote warehouse

VCS -> import into Version Control -> Share Project on Gitee

Git, GitHub and gitee are used in idea to submit projects

Create gitee remote warehouse name, description information and whether to set the warehouse to private

Git, GitHub and gitee are used in idea to submit projects

Enter your account and password to log in to gitee and establish a connection

Git, GitHub and gitee are used in idea to submit projects

The bottom right corner of idea will pop upSuccessfully shared project on GiteeSuccessfully shared the project to gitee

Git, GitHub and gitee are used in idea to submit projects

Check your gitee remote code hosting platform. At this time, you should create a remote warehouse and push the projects and files to it

Git, GitHub and gitee are used in idea to submit projects

The other is that there is no remote warehouse you want to submit on gitee. Create a warehouse on gitee and push projects and files through GITPushTo the remote warehouse

Create gitee remote warehouse name, description information and whether to set the warehouse to private on gitee

Git, GitHub and gitee are used in idea to submit projects

Copy warehouse address

Git, GitHub and gitee are used in idea to submit projects

Where you want to pushRight click on project and file -> Git -> Repository -> Push

Git, GitHub and gitee are used in idea to submit projects

Define remote warehouse

Git, GitHub and gitee are used in idea to submit projects
Git, GitHub and gitee are used in idea to submit projects

git pull
git pull origin master
git pull origin master --allow-unrelated-histories

If there is a problem with push, click ideaTerminalEnter the above instructions in the terminal and push your project here. Where origin and master are your own names when you are the first remote warehouse. If not changed, they are origin and master by default