1

This is what I have:

I have a main branch ABC and two subbranches DEF and GHI. These two subbranches are used by two different people, Obviously.

I don't have a git client. I'm using a software called as Jenkins using which I can download code from a git repository.

I have URL for the main branch. https://github.com/abc/abc-app.git

But I don't have URL for a subbranch, I'm trying to obtain such a URL for one of those subbranches so that I can integrate it in Jenkins.

Is it possible?

Smokey
  • 1,857
  • 6
  • 33
  • 63

2 Answers2

1

Cloning in git clones the whole repository, including ALL the branches. Use git checkout <branch> to get the right branch after that, or in case of jenkins, see the section called Branches to build under Source code management - Git

1615903
  • 32,635
  • 12
  • 70
  • 99
  • I know that. But if, a sub branch URL was available, it would have been perfect. I was trying to get that. – Smokey Jun 01 '16 at 07:15
0

But if, a sub branch URL was available, it would have been perfect

There is not, but in a way, you can clone a single branch:

git clone <url> --branch <branch> --single-branch [<folder>]

It is not an url, but it still allow you to get only the branch you want.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250