Upload projects to Git, Git learning

Git

除了git还有svn、cvs这样的版本控制系统,它们的区别在于一个是分布式一个是集中式

The difference is that the centralized version control system needs to pull a copy from the server every time you write code, and if the server is lost, everything will be lost, and your local client only saves the current version information In other words, centralized is to put the code on a server for centralized management, and all your rollback and other operations need the support of the server.



foreword

集中式就是svn和csv这样的版本控制系统,分布式是git

  • The difference in distribution is that everyone's computer is a server. When you pull a code from the main warehouse, your computer is the server. You don't need to worry about the main warehouse being deleted or not found. You can freely Local rollback and submission. When you want to submit your code to the main warehouse, you only need to merge and push it to the main warehouse. At the same time, you can create a new warehouse of your own code to share with others.
  • Like centralized, they all have a main version number, and all version iterations are based on this version number, while distributed because each client is a server, git does not have a fixed version number, but one is calculated by a hash algorithm The id is used for rollback, and there is also a master warehouse. This warehouse is the main warehouse of all branch warehouses. We can push the submission to the master and merge it into the main warehouse. The version number of the main warehouse will be iterated once. Our client No matter how many times the git version number iterates, it has nothing to do with the master. Only when merging, the master will iterate once.

1. Upload the code to the Gitee warehouse?

Prospective
installation of git locally
to create a Gitee account

Two, steps

1. Create a warehouse in Gitee

insert image description here

2. Open the local project and enter Git global settings

git config --global user.name "名称"
git config --global user.email "邮箱账号"

3. Initialize/create warehouse

git init

4. View the current git status

git status

5. Add all files to the temporary storage area (index)

git add .

6. Submit to the warehouse area/local warehouse (Repository)

-m "commit comments"

git commit -m "first commit"

7. Establish a connection between the local warehouse and the remote warehouse

git remote add origin https://gitee.com/wan_long_bei/ddd.git

8. Push the local master branch to the origin host, and specify origin as the default host

git push -u origin "master"


Summarize

今天先到这里,后续持续更新,敬请关注

Guess you like

Origin blog.csdn.net/aaxzsuj/article/details/128239655
Recommended