Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8655143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:57:27+00:00 2026-06-12T14:57:27+00:00

I have Jenkins setup using git and use a github hook for continuous integration.

  • 0

I have Jenkins setup using git and use a github hook for continuous integration. I’m using a custom workspace directory. Under source code management, I use Git. I’m only checking out the master branch and I have $GIT_BRANCH-$GIT_COMMIT as my directory location in the “Local subdirectory for repo (optional)” field. In the build section, I’m executing a shell, where I’m performing:

- pwd
- ls
- cd $GIT_BRANCH-$GIT_COMMIT
- ...

The problem I’m getting is when performing, “cd $GIT_BRANCH-$GIT_COMMIT.” I receive the following error:

- /tmp/hudson7624299777846840848.sh: 4: cd: can't cd to master-9297429dba145737291168f284796421f73c0ee3 

Per pwd, I’m in the correct directory. ls does not show the directory as being created, which is why I receive this error. After the build has failed, I have checked the build host to see if the clone has been performed and directory has been created. It appears to have not. However, when I execute the build manually, the build passes. ls shows the directory.

Any insight here of why this occurs would be greatly appreciated. My goal here is to create a new directory with the latest source for every build so I can maintain a history of tests, metrics, etc. I’m new to Jenkins, so if there is a better way to do this I’m open to suggestions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:57:28+00:00Added an answer on June 12, 2026 at 2:57 pm

    Your variables can be resolved using the following syntax within the custom workspace directory field

    ${GIT_BRANCH}-${GIT_COMMIT}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently using jenkins/hudson for continuous integration a large mostly C++ project. We have
So we have continuous integration in Jenkins of our maven builds. We have a
We use Jenkins for the continuous integration of .NET web applications with NAnt/NUnit for
I have the following setup active and working: Jenkins with Git and Sonar plugins
I have a machine with Ubuntu 12.04 and have installed Jenkins ver. 1.424.6 using
We're trying to setup Jenkins, but we are having a couple issues. We have
I am working on a POC currently using Jenkins as CI server. I have
I have a Jenkins (Hudson) server setup that runs tests on a variety of
I have what seems to be a simple question regarding how to setup Jenkins
I have a git repository where I have created two different jobs in Jenkins

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.