Software Testing | Detailed steps for pycharm to associate with GitHub

Insert image description here

Introduction

GitHub is one of the world's largest open source code hosting platforms and PyCharma powerful Python integrated development environment. Using the two together can improve the efficiency of team collaboration and code management. This article will introduce in detail how to PyCharmmanage GitHubaccounts in , including how to set up GitHubaccounts, create new warehouses, clone existing warehouses, submit and push code, etc.

Environmental preparation

First of all, we need to install the Git environment and Pycharm. We will not go into details here. You can refer to my other articles for specific installation steps.

Step 1: Configure Git in pycharm

Start PyCharm, click [File] → [Settings] → [Version Control] → [Git], select the Git executable file path (the path will be displayed by default after the system installs git), click [Test], and the current path will be displayed. Git version, as shown below

Insert image description here

Add GitHub account

Start PyCharm, click [File] → [Settings] → [Version Control] → [GitHub], click the plus sign on the right side of the dialog box, a dialog box for entering the GitHub account and password will pop up, enter the GitHub account number in the input box Password and click it Log In, as shown below:

Insert image description here

Of course, we can also associate the GitHub account by adding a token. We need to generate our own token on GitHub and copy it to the input box, as shown below:

Insert image description here

The steps to generate a token are as follows. You can view my other article GitHub steps to generate a token.

After the addition is completed, the account information will be displayed, as shown below:

Insert image description here

Step 3: Create a new warehouse

  1. In PyCharm, click File -> New Project.
  2. In the project settings, select Version Control, then select Git.
  3. Fill in the project name and location and click Create.

Step 4: Clone the existing repository

  1. Open PyCharm.
  2. Click File -> New -> Project from Version Control.

Insert image description here

  1. In the pop-up dialog box, select "Git".
  2. Enter the URL of the GitHub repository you want to clone, select the storage location, and click Clone, as shown in the image below.

Insert image description here

Step 5: Submit and push code

  1. In PyCharm, open the project.
  2. In the Version Control panel on the left, you can see the files that have changed.

Insert image description here

  1. Right-click the file you want to commit and select "Git" -> "Commit File".
    Insert image description here

  2. In the dialog box that pops up, enter your commit message and click Commit.

Insert image description here

  1. To push changes to GitHub, right-click vcs and select "Git" -> "Push".

Insert image description here

Summarize

This article mainly introduces the steps to configure a GitHub account in pycharm, and combines GitHub to implement version control of the project. Now, we have successfully set up a GitHub account in PyCharm and can easily manage the code repository, commit and push changes. Through PyCharm's integrated version control function, we can more easily collaborate with the team, track the code change history, and manage GitHub projects.

Guess you like

Origin blog.csdn.net/Tester_muller/article/details/132760926