Skip to content

Fetching a remote branch not present/avail. locally. #7

Closed

Description

@grayghostvisuals

These are the steps to fetch a remote branch that is not locally available for your machine.

grayghostvisuals ✭ GrayGhostVisualsMacBookAir.local  ~/Sites/Effeckt.css on master
$ g fetch upstream
remote: Counting objects: 18, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 14 (delta 6), reused 6 (delta 2)
Unpacking objects: 100% (14/14), done.
From github.com:h5bp/Effeckt.css
 * [new branch]      gh-pages   -> upstream/gh-pages
 * [new branch]      master     -> upstream/master
grayghostvisuals ✭ GrayGhostVisualsMacBookAir.local  ~/Sites/Effeckt.css on master
$ g branch
* master
grayghostvisuals ✭ GrayGhostVisualsMacBookAir.local  ~/Sites/Effeckt.css on master
$ g checkout -b gh/pages upstream/gh-pages
Branch gh/pages set up to track remote branch gh-pages from upstream.
Switched to a new branch 'gh/pages'

Activity

  1. grayghostvisuals commented on Jul 16, 2013

    @grayghostvisuals
    OwnerAuthor

    There is also this little ditty about Jack and Diane

    git fetch <remote> <rbranch>:<lbranch> 
    git checkout <lbranch>

    looks like this...

    GrayGhost ✱ grayghostvisualsmacmini.local  ~/httpd/directory-name on r4
    $ git fetch origin deploy:deploy
    remote: Counting objects: 75, done.
    remote: Compressing objects: 100% (23/23), done.
    remote: Total 43 (delta 25), reused 33 (delta 18)
    Unpacking objects: 100% (43/43), done.
    From github.com:repo-owner/remo-name
     * [new branch]      deploy     -> deploy
  2. grayghostvisuals commented on Jul 16, 2013

    @grayghostvisuals
    OwnerAuthor

    Also works too

    git fetch
    git checkout -t <remote>/<branch>
  3. grayghostvisuals commented on Aug 14, 2013

    @grayghostvisuals
    OwnerAuthor
    grayghostvisuals ✭ GrayGhostVisualsMacBookAir.local  ~/Sites/[repo] on master
    $ g fetch origin
    grayghostvisuals ✭ GrayGhostVisualsMacBookAir.local  ~/Sites/[repo] on master
    $ git checkout -b public_site origin/public_site
    Branch public_site set up to track remote branch public_site from origin.
    Switched to a new branch 'public_site'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions