Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to realize the git Operation of Cloud Rock Code Base

Shulou Source: shulou.com Published: 2022-05-31 12:14:33 10月04日 Update

What this article shares to you is about how to implement the git operation of Cloud Rock code base. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

The operation of git is one of the important prerequisites for using Cloud engine, but I have never used git before, so in the process of using Cloud engine, this link almost made me give up using Cloud engine. Here are the steps for the first time I used Cloud engine, the git library.

A template application named "javatesting" is created in the Cloud Rock console, and Cloud Rock automatically creates a code base with the address "https://code.jd.com/cdxiongli_m/jae_javatesting"" in the code base.

Download and install git, check the Cloud engine help documentation, click to view the git easy tutorial in the "Application engine console" chapter to learn how to install git.

After installing git locally using the default path, open the git command line, Git Bash.vbs, and set the local ssh key:

$cd. Ssh checks the local ssh key

If prompted: No such file or directory indicates that you are using git for the first time.

If this is not the first time to use it, do the following to clean up the original ssh key.

$mkdir key_backup

$cp id_rsa* key_backup

$rm id_rsa*

Generate a new key:

Ssh-keygen-t rsa-C "cdxiongli@jd.com" / / email used when logging in to Cloud engine

4. Open the local .ssh/id_rsa.pub file. The content of this file is the adult key just born. The local default path is C:\ Users\ local user name\ .ssh\ id_rsa.pub to copy everything in id_rsa.pub.

5. Log in to the cloud engine code base. SSH Management-> add, copy everything in id_rsa.pub to the public key text box, and click Save. When setting up git locally for the first time, you must:

$git config-- user name on global user.name "cdxiongli_m" / / Cloud Rock code base

$git config-- global user.email "cdxiongli@jd.com" / / fill in your email address

At this point, configure git, and test whether git is connected to the code base of Cloud Rock.

$git clone https://code.jd.com/cdxiongli_m/jae_javatesting.git

If you print the content, congratulations, you can already use git to upload and download the code and deploy the application.

The above is how to implement the git operation of Cloud Rock code base. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Tags: Code key content first time application console file more user user name knowledge article path mailbox learning control generation practical important upload and download Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux NVidia vpn Docker Huawei