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 upload your project code to github using pycharm

2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces how to use pycharm to upload their own project code to github, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand.

1. Sort out the relationship among Git, github and gitee: 1.1and Github

First of all, from the github that we are most familiar with, it is actually a code hosting platform, and we can build a lot of new warehouses in it. I understand that a warehouse is a project code of its own. These repositories can be public or private, and public repositories can allow others to download our code, thus achieving the goal of open source code. What is private is that only you have permission.

1.2 、 Gitee

Secondly, gitee, which is actually a code hosting platform, is a domestic platform. Its function is exactly the same as that of github. One more function is to allow the enterprise version to experience for free. While github is foreign, it has been acquired by WR.

1.3 、 Git

In fact, whether you put the code on github or gitee, you need to use git. This git is actually a system, a control system, and we can upload the code to gitee or github only after we have installed it.

So if you want to host your project code on github, you have to install git first, and then sign up for a Github account

2. How to install Git

The trouble with Git installation is its download

Baidu searches for Git and enters the official website, which is very difficult to access and download. Next, we can use domestic mirror sources to download.

Refer to the following steps

When downloading git, read the advanced official website.

Https://git-scm.com/download/win

Then found a few kb network speed, this is to let me next year, find out if there is any other mirror image on the Internet, found that Ali has a mirror image, download speed is super fast.

Web site: https://npm.taobao.org/mirrors/git-for-windows/

Go in and choose the version you want and click to download it.

According to our own system, we can find the latest version to download.

After downloading, double-click to install

After installation, open Git Bsah, which is the same window as our terminal:

Then enter some commands to connect him to our Github, such as giving him a username and password. It will be troublesome to use this to upload code based on imperative operations. There are also tutorials on the Internet that tell us how to upload our code using git.

So there will be an easy and visual operation to upload our code to github and gitee without opening the terminal command window.

Upload the code to github or gitee based on Pycharm. 1. Install a plug-in first:

Open pycharm-- > File-- > Settings-- > Plugins-- > search github

Click install Install; to search for Gitee installation in the same way; (no Github was found, I installed Github Tools and Github Theme)

2. Sign up for a github account

(if you use the first terminal command to upload code, you need to build a warehouse first, but if you use pycharm, you don't need to build a warehouse in advance.)

Open pycharm-- > VCS-- > Share Project on Github (this is the step in my own version)

Pycharm-- > VCS-- > Import into Version Control-- > Share Project on Github (other versions may be this step)

The box below pops up: because I have already entered my mailbox and password before, there will be no window for us to enter our username and password.

Repository says that when the project is uploaded, you want to build a new warehouse, so this can be named according to your personal habits. (cannot be in Chinese)

Remote: it doesn't matter. You can fill in it yourself.

Description: you can fill in it or you don't have to

After clicking Share, the following window appears, which means which of the files you want to synchronize to the warehouse on github? if all are selected, they will all be synchronized.

This indicates that you are uploading:

Uploaded successfully:

Then let's switch to github and take a look:

-so far, we have pushed our python code to github through pycharm based on installing plug-ins-

The above automatically marks the .py file as blue because the code has been modified and comments have been added

There is another problem. If we modify this code, how can we update it to github? Unlike our word, after changing the file, it will be saved automatically; we need to push it manually.

Push the above annotated code to github, that is, how to push the updated code to github:

Git-- > Commit (steps after updating the IDE of Pycharm)

VCS-- > Commit (steps before update)

Go to the next interface:

If you don't write, he will prompt you:

After writing:

After Commit:

At this time, it is not finished yet, and it is still not uploaded. We just told Pycharm that we want to make the modified detection.py, that is, the status at this time is blue, indicating that we have changed it. This needs to be pushed, but it has not been pushed yet.

GIt-- > Push

Push is the interface that tells us what we want to Push:

Look at the status bar below that shows that you are Push:

After the success of Push, there will be a prompt:

Go back to Github and take a look:

-so far, uploading the updated code to github based on installing the plug-in is over.

Another way to verify that your project has been uploaded is:

Git-- > Github-- > Share Project on Github

It will remind you that the project already exists; you won't have to build a new one.

The second question: the above only updated the code, and there is no new file, for example, if we create a new test.py file on the original project, will he prompt us to automatically update the file to the Github repository?

After clicking Enter, the following screen appears:

Click Add if you need it. You don't need to Cancel; and then it depends on you.

If it's Add, it's followed by Commit, and then Push.

Question3: when we pushed to github for the first time, we selected all the project content, but if we only chose part of the content push and some of the content did not push, what should we do if we want to push later?

(keep in mind that if we directly use the Commit in the top menu bar at this time, it shows that what we want us to push is what we selected for the first time, but it does not show the part that has not been pushed, that is, the content that has not been pushed for the first time will not appear.)

At this time, we need to right-click on the project content to be pushed, select Git, and select Add. At this time, the name of the content to be pushed will change color, which indicates that we have added it to our Commit. At this time, we go back to the Git in the top menu bar and select Commit, and the content that has not been added will appear. After that, Push will be fine.

Thank you for reading this article carefully. I hope the article "how to upload your project code to github using pycharm" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and follow the industry information channel. More related knowledge is waiting for you 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

Development

Wechat

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

12
Report