Detailed explanation of Git GUI, SSH protocol and Git usage in IDEA

Table of contents

Preface

1. Use of Git GUI

1. What is Git GUI

2. Common Git GUI tools

3.Use

4. Advantages and disadvantages of using Git GUI tools

advantage:

shortcoming:

2. SSH protocol

1.What is SSH protocol

2. Main features and functions of SSH

3. Principle and process of SSH key authentication

4. Use of SSH protocol

3. IEDA uses git

Configure installation path

Download the Git plugin

Login user

IDEA clones the uploaded code cloud code 

Submit push code in IDEA


Preface

        In the field of software development, version control is a very important part. As one of the most popular version control systems currently, Git provides developers with convenient code management and collaboration tools. This article will introduce in detail how to use the Git GUI tool and how to configure the SSH protocol for secure remote warehouse access. At the same time, we will also delve into the Git functions integrated in IntelliJ IDEA to provide developers with a more convenient code management experience.

1. Use of Git GUI

1. What is Git GUI

Git GUI refers to the Graphical User Interface tool, an interface used to interact with Git. It provides an intuitive way to manage and operate Git repositories. Compared with command line Git, Git GUI is more friendly and easy to use.

Differences and advantages from command line Git

  • Introduces the advantages of Git GUI compared to command-line Git, such as intuitively displaying version history, branch structure, and submission records.
  • Emphasize the advantages of Git GUI in visual operation, rapid learning and cross-platform use.

2. Common Git GUI tools

TortoiseGit

  • Features: Commonly used Git GUI tools on Windows platforms are integrated with the resource manager to provide convenient operation.
  • Applicable scenarios: Individual developers or small teams who need simple and intuitive Git interface operations.

GitHub Desktop

  • Features: Git GUI tool officially launched by GitHub, seamlessly integrated with GitHub warehouse.
  • Applicable scenarios: GitHub users who want to manage local and remote warehouses through a visual interface.

Sourcetree

  • Features: Feature-rich cross-platform Git GUI tool, supporting Git and Mercurial.
  • Applicable scenarios: Developers or teams that require support for complex operations and advanced functions.

3.Use

Create a new warehouse in Git in advance and perform some basic operations. I won’t demonstrate too much here. You can check out the Git installation and configuration nanny-level tutorial and the basic principles and common commands of creating a warehouse with Git . This blog post

Right-click on the local repository and select Git GUI Here

We first created my warehouse in gitee, and then cloned it directly

After entering we can see the following interface 

 This is the file we cloned

 We create a few new files for testing using the GUI

At this point we refresh the following in the graphical interface

 

 

4. Advantages and disadvantages of using Git GUI tools

advantage:

  1. Easy to use:  For developers who are not familiar with command line operations, Git GUI provides an intuitive graphical interface, making version control operations more intuitive and easy to use.
  2. Visual operations:  Git GUI tools usually provide functions such as visual submission, branch management, and code changes, allowing developers to easily perform these operations through a graphical interface without having to memorize all Git commands.
  3. Cross-platform:  Many Git GUI tools support multiple operating systems, so they can be used on different platforms such as Windows, Mac, and Linux, meeting the needs of different developers.

shortcoming:

  1. Learning curve:  Although Git GUI tools simplify some operations, for some advanced Git operations or customized needs, you still need to understand the basic principles and commands of Git, so it may take some time to learn.
  2. Functional limitations:  Some Git GUI tools may not fully cover all functions of Git, especially for some more complex operations, which may require the use of the command line.
  3. Performance:  Some Git GUI tools may have a certain performance loss compared to command line operations, especially when dealing with large code repositories.

2. SSH protocol

1.What is SSH protocol

SSH (Secure Shell) is a network protocol used to securely transmit data over the network. It provides an encrypted channel for securely connecting to remote systems over unsecured networks such as the Internet. SSH was originally designed to replace insecure methods of remote login and command execution such as telnet and rsh. Currently, SSH is widely used in fields such as remote server management, file transfer, and encrypted tunnels.

what is ssh key

        SSH key is a key-based authentication method used for remote SSH connections. It includes a private key and a public key. The private key is stored on the client computer, while the public key is placed on the server. When a client attempts to connect to the server, the server asks the client for a private key for authentication. If the verification is successful, the client will be able to communicate with the server through the SSH protocol.

2. Main features and functions of SSH

  1. Encrypted communication:  SSH uses encryption technology to encrypt communication data, thereby preventing unauthorized visitors from stealing information.
  2. Authentication:  SSH supports multiple authentication methods, including password-based, public key and two-factor authentication to ensure the legitimacy of the user's identity.
  3. Remote login and command execution:  Users can securely log in to remote hosts via SSH and execute commands on the remote system.
  4. Secure file transfer:  The SSH protocol also provides protocols for secure file transfer, such as SCP (Secure Copy Protocol) and SFTP (Secure File Transfer Protocol).
  5. Port forwarding:  SSH supports port forwarding function, allowing users to safely map local ports to remote hosts to achieve secure network tunnels.

3. Principle and process of SSH key authentication

SSH key authentication is based on public key encryption technology, realizing a more secure and convenient authentication method. Its principle and process are as follows:

  1. Generate a key pair:  The user uses a tool on the local system to generate a pair of keys, including a private key and a public key.
  2. Configure the public key to the remote server:  The user configures the generated public key into authorized_keysa file on the remote server so that the remote server can authenticate.
  3. SSH connection process:
  • When the client initiates a connection request, the server will send a random challenge to the client.
  • The client signs the challenge using the private key and sends the signed result to the server.
  • After the server receives the signed result, it uses the pre-configured public key to verify the signature. If the verification is successful, it indicates that the user's identity is legitimate and the login is allowed.

4. Use of SSH protocol

Turn the warehouse into a private warehouse, create a new folder to store and clone the private warehouse

We will clone through SSH protocol, first we need to add the public key, and then set the public key

Add public key

  First, enter cd ~/.ssh in the command window to see if there is a generated ssh

 If there is no public key, we will generate a public key. Enter ssh-keygen -t rsa -C "Email". Email is the email you configured. If you don't know, you can check it in the .gitconfig file, and then press three Enter keys.

Then we configure the public key to our gitee. After clicking OK, we need to enter the gitee login password to generate our ssh key.

 After success, we choose SSH for cloning test

Select the location you want to clone, right-click Git Bash Here --->git clone  [url]

3. IEDA uses git

IEDA usually provides a terminal or command line-like interface through which you can use Git command line tools. In IEDA, you can execute various Git commands through the command line, such as git clonecloning the warehouse, git addadding files to the staging area, git commitcommitting changes, etc.

Configure installation path

To integrate Git into IntelliJ IDEA, you can follow these steps:

Open the IntelliJ IDEA software.
Click File and select Settings in the pop-up menu.
In the settings window, select Version Control and click Git.
In the Git settings window, select the path drop-down menu and select the Git\bin\git.exe installation path.

Download the Git plugin

File/settings/plugins

Login user

Find Version Control >>> Gitee here and select the corresponding login method to log in.

Login via gitee

  1. Click and follow the operation
  2. Log in with password

Use your login account and password to log in. This method is still very easy to log in.

Log in using token

Enter gitee

 In this way, the token is generated successfully.

Copy your token to log in

login successful 

 Upload project

After selecting the project you want to upload, find VCS in the upper navigation bar and do the following:

Then click to select private and fill in the corresponding information, then click share, as follows: 

Remote warehouse:

 IDEA clones the uploaded code cloud code 

SSH path to copy file code

Clone code

 Then click Clone and click Yes.

 Submit push code in IDEA

submit

Perform the add operation and submit the file to Git management

Perform a commit operation and upload the file to the local warehouse

Push, perform push operation 

Push successful

View remote warehouse 

If we are pulling code or files, perform the pull operation

Guess you like

Origin blog.csdn.net/weixin_74268571/article/details/134339149