Pushing code from one branch of a repo to another branch of another repo

前端 未结 3 615
日久生厌
日久生厌 2021-02-05 06:59

There is a repo say ABC/A. I had forked this repo to my own github say ME/A. I was asked to create a branch on ME/A say x (originally there were develop and master). I had to wr

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-05 07:39

    Assume that the name of the remote you are using for ME is called me (git remote -v show will list them).

    Then with your branch checked out, do

    git push -u me A
    

    where A is the name of the branch. The -u will set your local branch to track the upstream branch on me, so git pull will pull from the right place, and future git pushes will work without additional commands.

提交回复
热议问题