How to cleanly get/copy a remote git branch to local repository

前端 未结 2 1724
广开言路
广开言路 2021-01-30 03:45

I want an exact \"copy\" of a remote branch \"copied\" to a specific local branch.

Say, for example, a team member has created an experimental feature, which he has che

2条回答
  •  鱼传尺愫
    2021-01-30 04:31

    I don’t have enough rep to comment, but I’d like to add an example for those still struggling. In my example, I’m using Github as my remote and copying the branch to my Linux server environment/terminal.

    First, you’ll want to run git fetch To make sure you’re up to date.

    Using the example of

    git checkout -b /

    With a remote branch named “picklerick”

    I ran

    git checkout -b picklerick remotes/origin/picklerick

    I probably could have just used remote/picklerick for my remote path, but this worked for me.

提交回复
热议问题