While trying to build a git project through jenkins it gives an error 'ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job. Finished: FAILURE' What does this error means and what should I do to remove it?
While building a git project from jenkins it shows an error like couldn't find any revision to build
            Asked
            
        
        
            Active
            
        
            Viewed 1.8k times
        
    6
            
            
        - 
                    I think this happens because it is a newly created repository and no commits have been done till now. After committing this error may solve. – Tony Davis Feb 26 '14 at 05:16
- 
                    1The link posted by Abhishek has nothing to do with the question. It's about a completely unrelated problem. – shawn1874 Sep 17 '18 at 15:56
- 
                    @TonyDavis I have a repo with commits still I am getting this error! any help is appreciated – Ashish Karpe Apr 12 '21 at 06:06
2 Answers
5
            I confirm: an empty repo has no HEAD, and no branch. I mention this in "Why do I need to explicitly push a new branch?"
That means Jenkins, once the repo is cloned won't be able to checkout a branch (since there is none yet).
5
            
            
        Please check the name of your branch to see if it is called main or master.
- If the branch is called - main, set the branches to build to- */main. (By default, GitHub names the default branch- mainin any new repository).
- If the branch is called - master, set the branches to build to- */master.
 
    
    
        vatbub
        
- 2,713
- 18
- 41
 
    
    
        Rathinam Shanmugam
        
- 131
- 2
- 1
 
     
    