Github common resource search skills & project push and pull - basic usage
Article directory
- Github common resource search skills & project push and pull - basic usage
- Preface
- 1. Some approaches to open source projects
- 2. Tips for finding resources - common prefixes and suffixes
- 3. Git download and installation
- 4. Use Git to complete Push & Pull
- 五、Pycharm Git push Github
- 6. Frequently Asked Questions Record
Preface
GitHub is a code hosting platform based on Git, but it is more than just a simple code hosting service. The following are the main functions and features of GitHub:
-
Code Hosting: GitHub provides a platform that allows developers to store and version control their code.
-
Version Control: Based on Git, GitHub allows multiple people to work in parallel on the same project and track every modification made by each person.
-
Collaboration: GitHub provides a series of tools, such as issue tracking, project management, and code review, making it easier for multiple people to collaborate.
-
Open Source Culture: GitHub is the center of open source culture. Millions of open source projects are hosted on GitHub and anyone can contribute to or use them.
-
Integrations: GitHub provides APIs and other tools that allow integration with other platforms and tools.
-
GitHub Pages: Allows users and organizations to use GitHub repositories to host their personal, organizational, or project's static websites.
-
Social network features: Functions such as following users, adding stars to warehouses, subscribing to warehouses, etc. allow developers to interact and learn from other developers.
-
Code Review: GitHub provides code review tools that allow developers to review code before merging it.
-
Security: GitHub offers several security features, such as two-factor authentication and dependency scanning.
-
GitHub Actions: This is a CI/CD tool that allows automating software workflows such as building, testing, and deploying applications.
In short, GitHub is a platform for developers to host, share, discuss, and collaborate on code development, as well as a huge open source community where developers can learn, communicate, and contribute.
1. Some approaches to open source projects
1.1 https://github.com/trending/
- Real-time popular projects: GitHub Trending provides a real-time, dynamically updated list showing the projects that are currently most concerned by developers;
- Developers can filter popular projects based on the programming languages they are interested in, making it easier to find relevant projects;
- Discover new technologies and trends: Through GitHub Trending, developers can discover new technologies, tools, and best practices in a timely manner to keep their skills and knowledge cutting-edge;
1.2 https://github.com/521xueweihan/HelloGitHub
- Help developers find interesting open source projects more easily
1.3 https://github.com/ruanyf/weekly
- The GitHub repository maintained by teacher Ruan Yifeng mainly shares weekly Internet technology articles;
- This repository is updated with new content every week, providing readers with a continuing source of technical information.
- This weekly does not only focus on a specific technical field, it covers front-end, back-end, tools, resources, news and other aspects, providing readers with a comprehensive technical vision;
2. Tips for finding resources - common prefixes and suffixes
2.1 Find encyclopedia awesome xxx
- This repository collects and lists excellent resources on specific topics or technical areas, such as tools, libraries, tutorials, and software. It is a great place to discover new tools or learn new skills;
- Direct search: Enter “awesome + technical keywords” in the GitHub search box. If you want to find resources related to Python, you can search for “awesome python”;
2.2 Find examples xxx sample
- "sample" usually refers to sample code or projects that show how to use a certain library, framework or technology, which can help developers quickly understand and get started with a new technology;
- Basic search: If you want to find samples related to Android, you can search for "sample android";
- Use quotation marks: For a more precise match, you can use quotation marks, for example, "sample project for android";
- Advanced search: Filter by language, fork number, star number, etc. Android examples using Java language: "sample android language:java";
2.3 Find an empty project shelf xxx starter / xxx boilerplate
- A “starter” usually refers to a starting template or project provided for a specific technology or framework;
- Basic search: Enter "keyword technology starter" in the GitHub search box;
2.4 Find tutorial xxx tutorial
- "Tutorial" usually refers to a tutorial or study guide for a specific technology, tool, or concept;
- Basic search: Enter "keyword technology tutorial" in the GitHub search box;
3. Git download and installation
1. Official website address:https://git-scm.com/
2. Download the Git installation package
3. Check the component configuration
4. The default editor for Git files is Vim. If you install VSCode, choose the third one. If it is not installed, the default will be fine;
5. Set the name of the initial branch in the new repository: The default name of the initial branch is master
, and everything else will default to next;
6 , Installation completed
7. Enter Git, right-click on the desktop/file directory and two options will appear, namely Git GUI Here
and Git Bash Here
;
Git GUI is a visual operation tool for Git (Git GUI Here, open Git GUI here)
Git Bash is a console supporting Git ( Git Bash Here, open Git Bash here)
4. Use Git to complete Push & Pull
4.1 Push
1. Drop-down command: git clone Github项目的git地址
;
2. Right-click in the local project folder to enter Git Bash Here, git clone https://github.com/sourcey/materiallogindemo.git
;
4.2 Pull
4.2.1 Create warehouse
1. Click on the avatar, select "Your repositories", and select "New repository";
2. Fill in the warehouse details
- Repository name: Enter a name for your repository;
- Description (optional): Provide a short description for your repository;
- Visibility: Choose whether your repository is public (
Public
) or private (Private
); - Add a README file (optional), you can choose to add a
README
file, which is a file describing your project; - Add .gitignore (optional),
.gitignore
file can help you ignore some unnecessary files; - Choose a license, you can also choose to add a license. Common licenses will be introduced below. Generally, non-commercial projects can choose
Apache License 2.0
; - Common licenses: MIT License, which is a very permissive license that allows others to do anything as long as they include the original license and copyright notice in all copies or significant portions;
- Common licenses: GNU GPLv3, which is a "contagious" license, meaning that any derivative works based on your code must also use the same license;
- Common licenses: Apache License 2.0: Allows others to modify and distribute your code, but they must provide clear copyright notices for modified files;
- After completing the above steps, click the “Create repository” button;
4.2.2 Push the project to Github
1. After Github is created, enter Git Bash Here in the local project folder and enter the command to initialize the Git warehouse: git init
;
2. Link the local warehouse to GitHub: git remote add origin https://github.com/<username>/<repository>.git
;
3. If the warehouse contains some default README.md
, push; ; 7. The last step is push, ; before pushing, otherwise it will report file, you need to perform this operation : In When creating a warehouse, if you check Use 6. ; 5. Submit this change operation and add notes for this change;, and add all files in the current directory 4. Add files to the local warehouse, add a single txt file to pull the file to the local, and then execute , first use .gitignore
or LICENSE
git pull
git push
git add filename.txt
git add .
git commit -m "reason"
注意
README
git pull --rebase origin master
error: failed to push some refsto 远程仓库地址
git push -u origin master
五、Pycharm Git push Github
5.1. Bind pycharm to GitHub account & configure Git
1. Click File in the upper left corner, select Settings, then select Version Control, click GitHub that appears, and click "Add account". There are three ways to add, just choose one;
2. Configure a Git installation path, File/Settings/Version Control/Git in the upper left corner. After selecting the path, do not touch other things. Click apply in the lower right corner, and then click ok;
5.2. Share the entire project to GitHub through Pycharm and create a new warehouse
1. You can share the current project to GitHub and create a new warehouse through Git/Github/Share Project on Github at the top of the window;
5.3. In the existing warehouse, continue to push the project file
1. If GitHub has created a warehouse and needs to push the project to the warehouse, you need to initialize the local warehouse in the project file directorygit init
and establish a linkgit remote add origin 仓库地址
;
2. Next, click Git/Commit at the top of the window, you can select the project file in the commit section, select it and click COMMIT AND PUSH
3. Finally Click push to view it on GitHub;
6. Frequently Asked Questions Record
1. Problem:fatal: unable to access 'https://github.com/xxx.git/': OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
Solution: Execute in Git Bash Heregit config --global http.sslVerify false
Document address: https:/ /blog.csdn.net/cnds123321/article/details/118661080
2. Problem: error: failed to push some refsto 'https://github.com/xxx.git/'
Solution: Execute in Git Bash Heregit pull --rebase origin maste
Reason: Use the Reamdme file to initialize this warehouse
Document address:https://blog.csdn.net/qq_45893999/article/details/106273214< /span> Solution: System Settings/Search for Proxy/Then click the Edit button to open the proxy server and set the port to 7890. This is not useful for your normal Internet access. Impact, you can set it with confidence;
3. Problem: fatal: unable to access 'https://github.com/.../.git':Recv failure Connection was reset
Execute the following command in Git Bash Here to solve the problem
git config --global --unset http.proxy
git config --global --unset https.proxy
git config --global http.proxy http://127.0.0.1:7890
Document address:https://blog.csdn.net/m0_63230155/article/details/132070860