Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all branches in SVN

Tags:

svn

How I can list all branches in SVN repo which are nested deeply. I tried

svn ls %svn-url-to-branch-folder%

But it gives list of files and folders as well.

I have following branch structure in my SVN repo

  • /branches/branch-a
  • /branches/branch-a/branch-b
  • /branches/branch-a/branch-c
  • /branches/branch-a/branch-c/branch-d
  • /branches/branch-e
  • /branches/branch-f

So I need to get branch list with path (Not files/folder inside branches) e.g.

  • /branches/branch-a
  • /branches/branch-a/branch-b
  • /branches/branch-a/branch-c
  • /branches/branch-a/branch-c/branch-d
  • /branches/branch-e
  • /branches/branch-f
like image 879
M Faisal Hameed Avatar asked Jan 04 '23 03:01

M Faisal Hameed


1 Answers

You need to add the --depth option

svn ls http://snvServer/Project/branches/ --depth immediates

From subversion docs

--depth empty: Include only the immediate target of the operation, not any of its file or directory children.

--depth files: Include the immediate target of the operation and any of its immediate file children.

--depth immediates: Include the immediate target of the operation and any of its immediate file or directory children. The directory children will themselves be empty.

--depth infinity: Include the immediate target, its file and directory children, its children's children, and so on to full recursion.

like image 66
Joao Vitorino Avatar answered Jan 13 '23 14:01

Joao Vitorino