pycharm configuration github


Necessary for the environment

  1. pycharm 2020.1: integrated development environment, you need to install and configure the environment PyCharm development environment construction guide: installation, configuration and basic use tutorial
  2. Git: version control, you need to install git in advance. Installation and configuration tutorial - super detailed version
  3. win11: operating system
  4. github: need to register account and password in advance

Steps

1. Configure git and github in pycharm

1. First open your own local project in pycharm. If it has not been configured, the main interface should look like this. Here I use a brand new project as an example. You can see that there is a VCS in the top bar.
insert image description here
2. Add a git warehouse
Open the settings and click on version control. Click the + sign in the upper right corner, select "Directory", VCS select Git.
insert image description here
3. Test git
Double-click version control, select git in the opened list, then configure the installation path of git, click test to display the version and it is ok,
insert image description here
4. Configure github
Click the "+" sign on the right to add a github account, which can be added in the form of account password and token
insert image description here
. If you forget the password, you can reset the password with the github account.
insert image description here
Click Generate Token on GitHub to see how the Token is generated.
insert image description here
After the tool is configured, the next step is to add the warehouse on github to the project, or upload the local project to the github account.

2. Obtain ssh key

In your own project folder, click the right mouse button, select Git Bash here, the Git command box will pop up, enter the command ssh-keygen in the command box, and then click enter all the way, and fill in y when encountering y, then your system disk will be displayed Generate an id_rsa.pub and an id_rsa file in the .ssh folder under the user name, open the id_rsa.pub with Notepad, copy all the characters, then log in to your account in github, and select SSH and GPG Key in the account setting , create a new SSH Key, and paste all the copied characters here.
insert image description here

insert image description here
insert image description here

3. Connect the local project with the github warehouse

Option 1: Upload the local project to github, and github builds a warehouse for the corresponding project.
insert image description here
Click share project on GitHub
insert image description here
github, and the warehouse GithubTest will appear on github.
insert image description here
Option 2: Pull the github project into the development environment.
insert image description here
URL: Project address
Directory: Select the project address
and click clone.

4. Synchronize local projects to github

Then I started committing code for the first time. Click git on the top bar, then click Submit. Committing means to record a series of modifications to the project. At this time, it has not been synchronized to the remote github warehouse, but I just told the system in advance that I will synchronize these things. For the project created for the first time, all project files will be submitted by default for the first submission, and you can choose to uncheck the files that will not be submitted temporarily. For example, here I will not submit the .idea folder by default, and then fill in the submission information, which is the description of this submission. You can describe the modification information submitted this time, and then click the submit button below.
insert image description here
insert image description here
insert image description here

Related questions

Solve the problem that GitHub always times out and cannot go up Solve
: Receive "core.useBuiltinFSMonitor will be deprecated soon" message when cloning in Git

reference article

Upload your own local project to the github warehouse in Pycharm - suitable for "novice" with certain experience

Guess you like

Origin blog.csdn.net/weixin_42491648/article/details/131684553