Home > Article > Development Tools > What is the relationship between git and github?
The relationship between git and github is: github is a warehouse hosting platform based on git; GitHub is a hosting platform for open source and private software projects, because it only supports Git as the only version library format for hosting, so Named GitHub, Git is an open source distributed version control system that can effectively and quickly handle version management of projects from small to very large.
The operating environment of this article: Windows 10 system, Git version 2.30.0, Dell G3 computer.
Git is a version management tool, and github is a warehouse hosting platform based on git (Of course github is far more than that now) , so the relationship between git and github is self-evident. They have made great contributions to software construction and management and open source software.
GIT
Git is a free, open source distributed version control system for agile and efficient processing of any project, small or large. s project.
Git is an open source distributed version control system that can effectively and quickly handle version management of projects from small to very large. Git is an open source version control software developed by Linus Torvalds to help manage Linux kernel development.
Torvalds began developing Git as an interim replacement for BitKeeper, which had been the primary source code tool used by Linux kernel developers around the world. Some people in the open source community felt that BitKeeper's license was not suitable for the work of the open source community, so Torvalds decided to start working on a version control system with a more flexible license. Although Git was originally developed to assist in the Linux kernel development process, we have found Git used in many other free software projects. For example, many Freedesktop projects have been migrated to Git.
github
GitHub is a hosting platform for open source and private software projects, because it only supports Git as the only version library format for hosting. , hence the name GitHub.
GitHub was officially launched on April 10, 2008. In addition to Git code warehouse hosting and basic Web management interface, it also provides subscriptions, discussion groups, text rendering, online file editors, and collaboration graphs (reports). ), code snippet sharing (Gist) and other functions. Currently, it has more than 3.5 million registered users and a large number of hosted versions, including well-known open source projects such as Ruby on Rails and jQuery.
Knowledge expansion:
Upload the project to GitHub
GitHub URL: https://github.com/
This article will not go into details about the creation of accounts. The use of GitHub, Gitee, etc. is basically the same.
a. Create a remote warehouse
The account you just created does not have any projects, we need to create it ourselves
b , Create a remote warehouse on GitHub
// 如果本地没有仓库,我们可以使用如下命令进行关联echo "# practice" >> README.md // 创建文件git init // 初始化仓库git add README.md // 上传到暂存区git commit -m "first commit" // 提交到本地仓库git branch -M main // 对当前分支重命名为main分支git remote add origin https://github.com/codeguowq99/practice.git // 将本地仓库和远程仓库进行关联git push -u origin main // 将本地仓库的所有修改What is the relationship between git and github?// 如果本地已经存在仓库git remote add origin https://github.com/codeguowq99/practice.git // 将本地仓库和远程仓库进行关联git branch -M main // 对当前分支重命名为main分支git push -u origin main // 将本地仓库的所有修改What is the relationship between git and github?
Note: The premise of the above steps is to generate the ssh key locally, and then upload the public key to GitHub under Settings. (For information on ssh, please refer to my other articles)
After completing these steps, I can associate the previously created project with the remote warehouse and push the contents of the local warehouse to the remote warehouse.
After the push is completed, we refresh the GitHub page and see that our project has arrived in the cloud.
At this point we can publish our project to the remote warehouse. In the subsequent use process, we can first commit
to the local warehouse and then push
Remote warehouse.
Recommended study: "Git Tutorial"
The above is the detailed content of What is the relationship between git and github?. For more information, please follow other related articles on the PHP Chinese website!