Skip to content

Instantly share code, notes, and snippets.

@zaimramlan
Last active September 11, 2016 15:11
Show Gist options
  • Select an option

  • Save zaimramlan/e8e5c31ec47c22cce2f2e321a25b9583 to your computer and use it in GitHub Desktop.

Select an option

Save zaimramlan/e8e5c31ec47c22cce2f2e321a25b9583 to your computer and use it in GitHub Desktop.
Git - Locally branching into a remote branch

Step 1: Fetch latest data from [REMOTE_NAME] i.e. origin

$ git fetch [REMOTE_NAME]

Step 2: Create and checkout into the desired remote branch

$ git checkout --track [REMOTE_NAME]/[REMOTE_BRANCH_NAME]

[REMOTE_NAME]: Name assigned to URL of the remote repository

[REMOTE_BRANCH_NAME]: Branch name in the remote repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment