Detailed introduction to dual git configuration
This article mainly shares with you the weird dual git configuration, hoping to help everyone.
Due to actual development needs, the company uses Gitlab, and I use Github privately. I want to configure both on the company computer at the same time.
There are many tutorials on the Internet for this configuration. I followed this tutorial at first, but they all failed. In the end, I succeeded based on my own operation. Realized the coexistence of Github and Gitlab.
1. Configure your own Github
##1.1. Under your own C:\Users\william folder , create a new .ssh folder through the command line tool mkdir .ssh;
1.2, cd .ssh, through ssh-keygen -t rsa - C "My email address" generates a pair of RSA keys for your own github, enter all the way until the end is successful
1.3, and then add the .ssh file Open the id_rsa.pub file in the folder, copy the contents and add it to the ssh of the github web version
1.4, through ssh -t git@github .com to test connectivity, where you can enter yes in Are you sure you want to continue connecting (yes/no)?
2. Configure yourself Gitlab
2.1, basically based on the company's configuration document, the basic operation is the same as above
3. Summary and Thoughts
##3.1 Summary- 3.1.1. Finally my. There are only config, id_rsa, id_rsa.pub, and known_hosts files in the ssh folder. Among them, I added the Github domain name pointing to the config file, otherwise the ssh -t git@github.com prompt failed.
- 3.1.2. According to the online tutorials, they may not be suitable for your own company. The main variable is that each company may have certain environment variables when configuring Gitlab. The difference is reflected in the different contents of the config file in the final .ssh folder and the known_hosts file, mainly the config file. Therefore, you must explore according to your own company's situation and find a configuration path that suits your situation. I spent most of the day reading several online tutorials but failed.
- 3.1.3. After github generates its own pair of RSA keys for github through ssh-keygen -t rsa -C "my email address", Enter file in which to save the key (C:\Users\william/.ssh/id_rsa): will let you choose a custom file name to save the key. If I do not enter, I will set my own custom file name, even if I put The generated public key was added to the SSH of the web page, and the final connectivity test failed. Of course, it cannot be cloned. It feels very strange.
- 3.2.1. Why do you customize Github? Does the last connectivity test of the key file name fail?
- 3.2.2. Why is it that after Gitlab customizes the file name, the final file name is still the default id_rsa, strange! ! !
- 3.2.3. There are only config, id_rsa, id_rsa.pub, and known_hosts files in the .ssh folder, but it can be connected to Github and Gitlab respectively. Indeed Very strange. You read that right, id_rsa and id_rsa.pub are only Gitlab keys, and Github ones are gone. Weird! ! ! !
The above is the detailed content of Detailed introduction to dual git configuration. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Title: The working principle and configuration method of GDM in Linux systems In Linux operating systems, GDM (GNOMEDisplayManager) is a common display manager used to control graphical user interface (GUI) login and user session management. This article will introduce the working principle and configuration method of GDM, as well as provide specific code examples. 1. Working principle of GDM GDM is the display manager in the GNOME desktop environment. It is responsible for starting the X server and providing the login interface. The user enters

Understanding Linux Bashrc: Function, Configuration and Usage In Linux systems, Bashrc (BourneAgainShellruncommands) is a very important configuration file, which contains various commands and settings that are automatically run when the system starts. The Bashrc file is usually located in the user's home directory and is a hidden file. Its function is to customize the Bashshell environment for the user. 1. Bashrc function setting environment

How to configure a workgroup in Win11 A workgroup is a way to connect multiple computers in a local area network, which allows files, printers, and other resources to be shared between computers. In Win11 system, configuring a workgroup is very simple, just follow the steps below. Step 1: Open the "Settings" application. First, click the "Start" button of the Win11 system, and then select the "Settings" application in the pop-up menu. You can also use the shortcut "Win+I" to open "Settings". Step 2: Select "System" In the Settings app, you will see multiple options. Please click the "System" option to enter the system settings page. Step 3: Select "About" In the "System" settings page, you will see multiple sub-options. Please click

Title: How to configure and install FTPS in Linux system, specific code examples are required. In Linux system, FTPS is a secure file transfer protocol. Compared with FTP, FTPS encrypts the transmitted data through TLS/SSL protocol, which improves Security of data transmission. In this article, we will introduce how to configure and install FTPS in a Linux system and provide specific code examples. Step 1: Install vsftpd Open the terminal and enter the following command to install vsftpd: sudo

MyBatisGenerator is a code generation tool officially provided by MyBatis, which can help developers quickly generate JavaBeans, Mapper interfaces and XML mapping files that conform to the database table structure. In the process of using MyBatisGenerator for code generation, the setting of configuration parameters is crucial. This article will start from the perspective of configuration parameters and deeply explore the functions of MyBatisGenerator.

PyCharm is a powerful Python integrated development environment with rich functions and tools that can greatly improve development efficiency. Among them, the replacement function is one of the functions frequently used in the development process, which can help developers quickly modify the code and improve the code quality. This article will introduce PyCharm's replacement function in detail, combined with specific code examples, to help novices better master and use this function. Introduction to the replacement function PyCharm's replacement function can help developers quickly replace specified text in the code

DRBD (DistributedReplicatedBlockDevice) is an open source solution for achieving data redundancy and high availability. Here is the tutorial to install and configure DRBD on CentOS7 system: Install DRBD: Open a terminal and log in to the CentOS7 system as administrator. Run the following command to install the DRBD package: sudoyuminstalldrbd Configure DRBD: Edit the DRBD configuration file (usually located in the /etc/drbd.d directory) to configure the settings for DRBD resources. For example, you can define the IP addresses, ports, and devices of the primary node and backup node. Make sure there is a network connection between the primary node and the backup node.

Dogecoin is a cryptocurrency created based on Internet memes, with no fixed supply cap, fast transaction times, low transaction fees, and a large meme community. Uses include small transactions, tips, and charitable donations. However, its unlimited supply, market volatility, and status as a joke coin also bring risks and concerns. What is Dogecoin? Dogecoin is a cryptocurrency created based on internet memes and jokes. Origin and History: Dogecoin was created in December 2013 by two software engineers, Billy Markus and Jackson Palmer. Inspired by the then-popular "Doge" meme, a comical photo featuring a Shiba Inu with broken English. Features and Benefits: Unlimited Supply: Unlike other cryptocurrencies such as Bitcoin
