Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
grayghostvisuals opened this issue Jul 5, 2013 · 3 comments
Closed

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

grayghostvisuals opened this issue Jul 5, 2013 · 3 comments

Comments

@grayghostvisuals
Copy link
Owner

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'
@grayghostvisuals
Copy link
Owner Author

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

@grayghostvisuals
Copy link
Owner Author

Also works too

git fetch
git checkout -t <remote>/<branch>

@grayghostvisuals
Copy link
Owner Author

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
Projects
None yet
Development

No branches or pull requests

1 participant