Git (revision control): How do I clone this branch that hasn't been merged into master in GitHub?
-
The author of this gem told me that if I wanted to use an updated version of Rails for his gem I could clone this link, but it doesn't have the usual url that I clone projects with on GitHub. I tried to do git clone {regular url see below) but it didn't work. https://github.com/xaviershay/enki/pull/47 and it
-
Answer:
You can clone a repo and switch to a specific branch in one step. In this case, you would run: $ git clone https://github.com/gevans/enki.git -b rails32 And you're done. If you're only interested in getting revisions specific to the branch you're checking out, you can run a shallow clone. The downside of a shallow clone is that you can't push or pull from it (collaboration is severely limited). The benefit is that you'll get what you need a lot faster. Here's an example: $ git clone https://github.com/gevans/enki.git -b rails32 --depth 1
Dan Loewenherz at Quora Visit the source
Other answers
You don't clone specific branches with git; you clone the entire repository, which includes all the branches. You can then run `git checkout branch-name` to switch to the branch you want to use. So in this case, follow these steps: 1. git clone https://github.com/gevans/enki.git This clones the entire `gevans/enki` repo onto your computer. 2. cd enki 3. git checkout rails32 This checks out the "rails32" branch name, which is the one the author is talking about in that Pull Request.
Jake Boxer
Related Q & A:
- How do I migrate a flat svn repo to git repo?Best solution by Stack Overflow
- How do I correctly move a git submodule?Best solution by Stack Overflow
- How can I concentrate on my revision for exams?Best solution by Yahoo! Answers
- How can i check phone calls from at&t.com?Best solution by Yahoo! Answers
- How do I record a movie on direct t.v?Best solution by ChaCha
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.