Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use GitHub under the Linux command line

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to use GitHub under the Linux command line". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use GitHub under the Linux command line.

1. Sign up for github account

two。 Create a ssh key

Cd ~

Ssh-keygen-t rsa-C your_email@example.com

The id_rsa.pub file is generated under ~ / .ssh /, and SSH and GPG keys-on the github website

> New SSH Keys, write the title casually, you can write the name of the computer, and change the contents of the id_rsa.pub

Paste in key, and finally click Add SSH Key.

3. Open the terminal

Ssh-T git@github.com

If you prompt Permission denied (publickey) for this step, execute ssh-keygen-t rsa

-b 4096-C "your_email@example.com" to regenerate key, a prompt appears indicating that the positive

Often connect to github

Hi ganchunsheng! You've successfully authenticated, but GitHub does

Not provide shell access.

4. Create a warehouse on github

Upload the code as follows:

Git init # initialization

Git add. # initialize the local warehouse

Git commit-m "first commit" # annotated and submitted to the local warehouse

Git remote add origin https://github.com/xxxx/test.git # connects to the remote warehouse

Git push-u origin master # submits things from the local warehouse to the master branch

5. Download the code

Master Branch:

Git clone https://github.com/xxxx/test.git # xxxx is the user name

Include subbranches:

Git clone-- recursive https://github.com/xxxx/test.git

6. common problem

(1) error prompt: fatal: remote origin already exists. Solution:

Git remote rm origin

(2) git is not initialized

* Please tell me who you are.

Run

Git config-global user.email "you@example.com"

Git config-global user.name "Your Name"

Solution:

Git config-global user.name "your_email"

Config-global user.email your_email@example.com

At this point, I believe you have a deeper understanding of "how to use GitHub under the Linux command line". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report