常用命令

1.新分支

  创建新分支:git branch <branch_name>

  创建分支并切换到新的分支上:git checkout -b <branch_name> 

2.切换到新分支:git checkout <branch_name> 

3.回滚版本:git reset –hard commit-id 

4.删除本地分支:git branch -D <branch_name> 

5.删除远程分支:git push origin --delete <branch_name>

6.将新分支上传到远程仓库:git push -u origin develop 

7.查看提交的记录:git log

例子

1.本地创建分支 ----> 提交到远程仓库

git checkout <branch_name> 
git push -u origin <branch_name>

1.删除本地分支 ---->同时远程分支

git checkout <branch_name> 
git push origin --delete <branch_name>

 

相关文章:

  • 2022-12-23
  • 2021-12-14
  • 2021-06-22
  • 2021-09-19
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2021-12-01
猜你喜欢
  • 2022-02-09
  • 2021-07-27
  • 2022-12-23
  • 2021-06-15
  • 2022-02-09
  • 2022-12-23
  • 2021-08-28
相关资源
相似解决方案