The easiest way to upload Git

Local warehouse construction

There are two ways to create a local warehouse: one is to create a brand new warehouse, and the other is to clone a remote warehouse.
1. To create a brand new warehouse, you need to use the root directory of the project managed by GIT to execute:
## 在当前目录新建一个Git代码库
$ git init


## 克隆一个项目和它的整个代码历史(版本信息)
$ git clone [url]  

## git add .                  添加所有文件到暂存区
## git commit -m "消息内容"    提交暂存区中的内容到本地仓库 -m 提交信息

git push

Add to staging area

commit

push to remote warehouse

GIT branch

# 列出所有本地分支
git branch

# 列出所有远程分支
git branch -r

# 新建一个分支,但依然停留在当前分支
git branch [branch-name]

# 新建一个分支,并切换到该分支
git checkout -b [branch]

# 合并指定分支到当前分支
$ git merge [branch]

# 删除分支
$ git branch -d [branch-name]

# 删除远程分支
$ git push origin --delete [branch-name]
$ git branch -dr [remote/branch]

Guess you like

Origin blog.csdn.net/weixin_46073538/article/details/113628761