How to clone git to a server?

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

Was this solution helpful to you?

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:

Just Added Q & A:

Find solution

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.