1,先指定commit ,创建一个分支

>0.git pull --rebase oirigin 基础分支

>1,git checkout -b new_branch (git branch new_branch;git checkout new_branch)
>2,指定commit上创建分支:git checkout commitId -b new_branch (或者 git checkout -b new_branch commit-sha-1 这个也就是commitid)

 >3,git push origin new_branch

 

2,在自己的分支上,改好,测试,并提交到自己的分支上

>2.1,先把修改的内容上传到自己分支下(git add ,git commit,git pull --rebase origin 自己的分支,git push origin 自己的分支)

 

3,合并到主分支上

>3.1,git checkout master
>3.2,git pull --rebase origin master 拉取最新的数据
>3.3,git merge new_branch
>3.4,如果遇到冲突,解决冲突(git status)
>3.5,例如git rm xxx, git add等
>3.6,git commit (注意:不要用m选项)
>3.7,git push origin master
>3.8,如果没有冲突,第1,2,3,7步骤就ok了

 

4, 删除本地分支
>4.1,git branch -d old_branch

 

5,删除远程分支

> git push origin --delete old_branch

 

6,重命名分支

>1,git pull --rebase origin old_branch

>2,git branch -m old_branch  new_branch

相关文章:

  • 2022-02-23
  • 2022-12-23
  • 2021-09-15
  • 2022-01-03
  • 2021-08-21
  • 2021-11-29
  • 2022-01-10
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2021-10-05
相关资源
相似解决方案