The git ls-remote command is not allowed to list remote files, only remote references (branches and tags).
Git providers (GitHub, Bitbucket, Gitea, Assembla, Beanstalk, Gitlab, etc.) generally provide one or more REST API's that will list remote files in a branch. On Thursday, October 10, 2019 at 11:37:34 PM UTC-8, Ajay Sharma wrote: > > Hi Everyone, Good Morning. > > Request any ones help to List All FILES from the GIT BRANCH. > I am trying to first list Branches of a GIT REPO, then list the files of > the BRANCH. > > I am facing problem while listing files of the BRANCH. > > I have used this code List files Of the GIT REPO with *Extended Choice > Parameter*. > > def gettags = ("git ls-remote -t -h > http://pramod:username.password@10.112.78.152/pramod/automaticjobs.git > ").execute() > return gettags.text.readLines().collect { > it.split()[1].replaceAll('refs/heads/', '').replaceAll('refs/tags/', > '').replaceAll("\\^\\{\\}", '') > } > > BUT this code is not working for Listing the Files of the GIT BRANCH. > > def gettags = ("git ls-remote -t -h > http://pramod:usernamepassword@10.112.78.152/pramod/automaticjobs.git -r > {env.Branches}").execute() > return gettags.text.readLines().collect { > it.split()[1].replaceAll('refs/heads/', '').replaceAll('refs/tags/', > '').replaceAll("\\^\\{\\}", '') > } > > > > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ad6d0852-7c2b-494d-a929-30043da22b5c%40googlegroups.com.