Git常用操作

1. 日常使用

  克隆项目 -- git clone + 地址

  查看状态 -- git status

  把所有修改的加到到本地 -- git add .

  提交到本地 -- git commit -m '备注'

  以master提交到服务器 -- git push -u origin master

  将远程仓库和本地连接 -- git remote add origin + 地址

2. 分支使用

2.1 查看分支

  git branch

2.2 创建分支

  git branch

2.3 切换分支

  git checkout 或者git switch

2.4 切换并切换分支

  git checkout -b 或者git switch -c

2.5 合并某到当前分支

  git merge

2.6 删除分支

  git branch -d

posted @ 2022-05-21 17:58  lyluoye  阅读(26)  评论(0)    收藏  举报