How to create a local branch from an existing remote branch?

后端 未结 5 2091
半阙折子戏
半阙折子戏 2021-01-31 08:42

I want to create a branch from an existing remote branch (let\'s say remote-A) and then commit the changes to the repository.

I have used the below commands to create a

5条回答
  •  情书的邮戳
    2021-01-31 09:11

    you want to create branch on base of remote-A, make changes on it and then push them on remote-A?

    git checkout -b remote-A
    git pull origin remote-A
    git checkout -b remote-B
    

    make changes on remote-B

     git commit -a -m 'describe changes on remote-B branch'
    
     git checkout remote-A  
     git merge remote-B  
     git push origin remote-A
    

提交回复
热议问题