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

Detailed tutorials for novice GitHub

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

one。 Install Git

1. Download git through the official website (https://www.git-scm.com/download/)) and enter the official website, as shown below:

two。 After selecting the corresponding operating system, the page jumps to and automatically downloads the corresponding Git version, as shown below:

3. After the download is complete, find the location of the download file, and double-click to install it:

The installation of 4.Git is relatively simple. Just click next and wait for the installation to be completed:

5. Enter any directory and right-click if the function menu of Git appears indicating that the installation is successful:

6.

two。 Register for Github

1. Enter the Github official website (https://github.com/), as shown in the figure:

two。 Start registration (only if the user name is not registered), and the user name can only contain alphanumeric characters or a single hyphen, and cannot begin or end with a hyphen. It is recommended to use Google browser, which can be converted into Chinese (English can be ignored), as shown in the figure:

3. To create a user, click the 'continue' button directly, as shown in the following figure:

4. Then there is a survey page, which can be skipped, as shown in the following figure:

5. At this point, we first verify the registered mailbox, as shown in the figure:

6. The mailbox for registration and GitHub authorization verification, as shown in the figure:

7. After the verification is successful, create a repository, as shown below:

8. After entering the parameters, it can be created successfully, as shown in the figure:

9. The created warehouse is shown in the following figure:

10.

III. Git is associated with GitHub account

First of all, you need to create a ssh key on the local Git, which will generate two parts of public/private rsa key. After you get it, and enter it in your GitHub account, your computer will be linked to your GitHub account, so that you can upload your code at any time through Git bash.

1. Local Git to create ssh key:

First use Git Bash to enter the console and enter ssh-keygen-t rsa-C "emailaddress"; (it is recommended that emailaddress use the email address when Github registers)

two。 When this prompt appears, first check the local public key:

Cd .ssh

3. Prompt No such file or directory indicates that you are using git for the first time. If it is not the first time to use it, please do the following and use the command to clean up the original ssh key:

Mkdir key_backup

Cp id_ras key_backup

Rm id_rsa

4. Use the ssh-keygen-t rsa-C "your email address" command to regenerate the new key:

5. At this point, the key is generated successfully. Next, to add the public key to GitHub, follow the path in 4 to open id_rsa.pub using notepad, copy and paste it into GitHub.

6. Log in to GitHub and go to the settings page, as shown in the figure:

7. Go to the SSH and GPG key add page, as shown in the following figure:

8. After adding the title, paste the public key in the corresponding key, as shown below:

9. If the addition is successful, the interface will prompt, as shown in the figure:

10. Check whether the Git and GitHub accounts are bound successfully, as shown in the following figure. Enter: ssh-T git@github.com in Git Bash. After entering the above code for the first binding, you will be prompted whether it is continue, and if it appears after entering yes: You've successfully authenticated, but GitHub does not provide shell access.

11. Enter the following command to configure the account. Name had better be the same as the one above GitHub. Email must be the email address where GitHub is registered.

twelve。 The test pulls the code on the GitHub locally. Randomly find a directory (preferably where you agree to put the code), right-click to enter the Git Bash interface, and enter the command: git clone https://github.com/DoneZhgd/Test.git (the address of the project branch in GitHub), as shown in the figure:

13. At this point, you can see the newly created Test directory with the code pulled from GitHub, as shown in the figure:

four。

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: 231

*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