Git Plugin

Skip to end of metadata
Go to start of metadata

Plugin Information

Plugin ID git Changes In Latest Release
Since Latest Release
Latest Release
Latest Release Date
Required Core
Dependencies
2.2.1
Apr 12, 2014
1.509
multiple-scms (version:0.2, optional)
token-macro (version:1.10, optional)
credentials (version:1.10)
parameterized-trigger (version:2.4, optional)
scm-api (version:0.2)
git-client (version:1.8.0)
promoted-builds (version:2.17, optional)
ssh-credentials (version:1.6.1)
Source Code
Issue Tracking
Maintainer(s)
GitHub
Open Issues
Kohsuke Kawaguchi (id: kohsuke)
Nicolas De Loof (id: ndeloof)
Usage Installations 2013-Apr 25907
2013-May 26964
2013-Jun 27687
2013-Jul 29423
2013-Aug 30202
2013-Sep 31116
2013-Oct 33588
2013-Nov 33483
2013-Dec 33354
2014-Jan 36196
2014-Feb 37646
2014-Mar 39746

This plugin allows use of Git as a build SCM. A recent Git runtime is required (1.7.9 minimum, 1.8.x recommended). Plugin is only tested on official git client. Use exotic installations at your own risks.

Configuration 

Repository URL should be in the format:

git@hostname.com:repository

Though arguably this is not a true URL, this is ssh compact format.  To test at the command line run: git.exe ls-remote <URL> 

Bugs

  • Check the open issues carefully to see if the issue has already been reported
  • Create an issue if needed, and make sure to choose the git sub-component.  Make sure to mention the plugin version number in the issue description.

Note: Source code can be found at https://github.com/jenkinsci/git-plugin.

Gotchas

  • If you are seeing output indicating Git could not clone, something like the output below, go to to the Jenkins configuration settings (not the project settings, the global ones) and change the Git path to a fully qualified path (eg. not "git" but "/usr/bin/git" or wherever your Git binary is installed). You should also verify that the permissions are correct if you are doing a file system based clone.
Started by user anonymous
Checkout:workspace / C:\Documents and Settings\Administrator\.hudson\jobs\watir\workspace - hudson.remoting.LocalChannel@1a1f370
Last Build : #4
Checkout:workspace / C:\Documents and Settings\Administrator\.hudson\jobs\watir\workspace - hudson.remoting.LocalChannel@1a1f370
Cloning the remote Git repository
Cloning repository origin
$ git clone -o origin git://github.com/bret/watir.git "C:\Documents and Settings\Administrator\.hudson\jobs\watir\workspace"
Trying next repository
ERROR: Could not clone from a repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:400)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:358)
    at hudson.FilePath.act(FilePath.java:676)
    at hudson.FilePath.act(FilePath.java:660)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:358)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:833)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:314)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:266)
    at hudson.model.Run.run(Run.java:948)
    at hudson.model.Build.run(Build.java:112)
    at hudson.model.ResourceController.execute(ResourceController.java:93)
    at hudson.model.Executor.run(Executor.java:118)
  • You may need to tell git who the user Jenkins is running as. To do this on a Linux/Unix system switch to that user which is probably tomcat6. Do this by using either of the following, which work even if the user is not supposed to have shell access.
    $ su - -s /bin/bash tomcat6
    $ sudo su - -s /bin/bash tomcat6
    

    Now cd to the directory where the clone Jenkins created is and use git config user.name and git config user.email to set the values.

    $ cd /srv/jenkins/jobs/project/workspace
    $ git config user.email "some@email.com"
    $ git config user.name "jenkins"
    

    When you are done, log off as the Jenkins user

Jenkins, GIT plugin and Windows

Installing the plugin itself works like a charm but configuring the system to work properly under Windows can be a be tricky. Let´s see the problems you may run into.

Configuring Jenkins to use OpenSSH bundled with msysgit Windows installer

By default, the Jenkins Windows installer sets up Jenkins to run as a service on Windows, which runs as the “Local System account”, NOT your user account. Since the “Local System account” does not have SSH keys or known_hosts set up, “git clone” will hang during the build.  It's possible to keep Jenkins running as the “Local System account” and clone repositories via SSH by making sure that the “Local System account” is set up with a properly configured .ssh directory (i.e. id_rsa, id_rsa.pub, AND known_hosts).  On my Windows 7 x64 box, this directory is C:\Windows\SysWOW64\config\systemprofile\.ssh

The first time you connect via SSH to a remote server, you would normally get prompted with the question "Are you sure you want to continue connecting (yes/no)?", which would populate the remote server info in your ~/.ssh/known_hosts.  Even with proper SSH keys set up for the Jenkins user, if you don't have a properly configured ~/.ssh/known_hosts, the build will still hang. 

A quick way to generate this known_hosts file is to copy your Jenkins build SSH keys into C:\Program Files (x86)\Git\.ssh (so that ssh.exe can find them), and run

 c:\>"C:\Program Files (x86)\Git\bin\ssh.exe" -T git@your.git.server

This will populate C:\Program Files (x86)\Git\.ssh\known_hosts and then you can just copy C:\Program Files (x86)\Git\.ssh to C:\Windows\SysWOW64\config\systemprofile\.ssh (the “Local System account” home).

For a more detailed tutorial, see http://computercamp-cdwilson-us.tumblr.com/post/48589650930/jenkins-git-clone-via-ssh-on-windows-7-x64

Added the server to your trusted list

First of all, if your system/user never connected to the git server, you will have to add the server to your list of trusted servers.
If you get something like this:

The authenticity of host 'GIT SERVER (127.0.0.1)' can't be established.
RSA key fingerprint is 41:d2:d9:31:76:7d:bd:0d:5e:3f:19:db:5d:34:4d:9d.
Are you sure you want to continue connecting (yes/no)? yes

or

The server's host key is not cached in the registry...

Find plink.exe on your system and run:

plink.exe yourgitserver.com

Answer Yes when prompt. You ignore the login part with CTRL+C.
Beware, this is user specific. SO if you run jenkins as user 'John', make sure you login as 'John' before running the previous command.

An alternative option is to add some entries in the registry to HKEY_USERS\.DEFAULT. You will typically run into this problem is you let Jenkins runn as "Local System" but try to add the key to your list while logged in with your user. The registry entries added for a specific user can be found here:

HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys

Setup your environment variables

General hint: Avoid spaces in environment paths

Mainly, you will need:

  • GIT_HOME => Folder where your git.exe is located
  • HOME => The parent folder of the folder containing your SSH Keys (e.g If your keys are in C:\SSHKeys, set HOME to C:)
  • PATH => Add the folder where your plink.exe is located

Once this is done, make sure you restart your consoles and the jenkins service.

SSH Keys

You will need to generate your SSH keys. The public key will have to be added/installed on the server. Systems like Gitorious, Gitosis or Github make it easy: you will have to simply copy/paste your key. If you need to setup the authentication with a 'simple' server, look for 'authorized_keys' in this document http://www.eng.cam.ac.uk/help/jpmg/ssh/authorized_keys_howto.html

You can read this: http://help.github.com/win-set-up-git/ to see how to generate the keys.

One solution to avoid entering your password (the one you defined in the ssh key in the process above) is to use Pageant.exe. Visit the link below for more details: http://www.ualberta.ca/CNS/RESEARCH/LinuxClusters/pka-putty.html

Note:* future *integration with ssh-credentials-plugin could help

Some windows fun

If you did everything, you should now have a ~/.ssh folder (c:\Users\Bob\.ssh for instance) and this folder contains your keys.
At that point, you may even be able to manually (from the console), clone your repository but Jenkins keeps failing with something like this:

code 128: Cloning into C:\Program Files\Jenkins\jobs\PG3\workspace...
fatal: The remote end hung up unexpectedly

If you run into this issue, you may need to copy the id_rsa* files from your ~./.ssh to another folder.
Find your git.exe and check if there is an .ssh folder there. If so, copy ~./ssh/id_rsa* to this folder and try again.

Push notification from repository

To minimize the delay between a push and a build, it is recommended to set up the post-receive hook in the repository to poke Jenkins when a new commit is made. To do this, add the following line in your hooks/post-receive where "URL of the Git repository" is the fully URL you use to clone this repository.

curl http://yourserver/jenkins/git/notifyCommit?url=<URL of the Git repository>[&branches=branch1[,branch2]*][&sha1=<commit ID>]

This will scan all the jobs that's configured to check out the specified URL, the optional branches, and if they are also configured with polling, it'll immediately trigger the polling (and if that finds a change worth a build, a build will be triggered in turn.) We require the polling configuration on the job so that we only trigger jobs that are supposed to be kicked from changes in the source tree.

This allows a script to remain the same when jobs come and go in Jenkins. Or if you have multiple repositories under a single repository host application (such as Gitosis), you can share a single post-receive hook script with all the repositories. Finally, this URL doesn't require authentication even for secured Jenkins, because the server doesn't directly use anything that the client is sending. It runs polling to verify that there is a change, before it actually starts a build.

When successful, this will return the list of projects that it triggered polling as a response.

Commit ID is optional. If set, it will immediately trigger a build, without requirement to poll for changes. Benefits is that you then can have all push tested by jenkins, even when developers push at ~ same time.

Why Not JGit

As of 1.2.0, the Git plugin uses git-client-plugin for all Git low-level operation. git-client was extracted from git plugin 1.1.x code base, to ensure SoC and allow other plugins (gerrit, git-parameters...) to directly use and contribute to this one when needed.

The git-client plugin 1.0.4 used JGit by default, while still including the command line Git implementation as an alternate implementation.  Initial deployments of the JGit based plugin exposed a number of gaps in the JGit implementation.  Those gaps need to be resolved in the JGit implementation before it can be used as the default implementation. Beginning wiht git-client-plugin 1.0.5, the command line implementation is the default implementation.

The git-client-plugin provides both command line and JGit implementations for the GitClient interface. Using command line demonstrated (based on large git plugin issue list) to be fragile : running an external process any time some git repository interaction is required introduces file and process leaks, filesystem locks, etc. It's highly system dependent and require user to install and configure adequate tools on all build slaves. It's based on parsing command output, and as such can be broken by any git cli update - legacy code already check git-cli version to detect which option can be used. Once the JGit functionality gaps are closed, we consider JGit will be the way to go. If you want to experiment with the JGit implementation, either configure JGit as an available git installation from the "Manage Jenkins" page, or run Jenkins with -Dorg.jenkinsci.plugins.gitclient.Git.useCLI=false (same for slaves).

Advanced Features

Using Git, Jenkins and pre-build branch merging

Continuous Integration tools such as Jenkins are useful on projects as they give users early indication that a particular codebase is 'unstable' - and that if a developer checks it out, there will be trouble ahead (they won't be able to work on their own code, because someone else has broken something).

Unfortunately, by the time the build completes, this is often too late (particularly if the build cycle time is very long), as a developer has updated their working copy to the latest, unstable code in the repository and has begun work.

This can lead to the code base remaining unstable as developers tread on each others toes steadily fixing one thing, but breaking something else.

Some environments (e.g. TeamCity) attempt to fix this by making commits into SVN only 'really' happen once they have been tested. These kinds of 'delayed-commits' are problematic, because local SCM tools assume that commits will be immediately available, which can confuse them. In many ways this mechanism is a hack to get around the fact that branch management in SVN is very heavyweight.

Fortunately, with GIT and Jenkins, you can achieve the same 'stable branches' with minimal effort.

Set up your Jenkins project, and leave the 'branch' field in the Git SCM blank. This will cause Jenkins to consider any change on any branch for building.

Next, pick a particular branch name as the integration target in the 'Advanced' section - (e.g. 'master', or 'stable'), and select 'Merge before build'.

Select 'Push GIT tags back to origin repository' from the post-build actions (this is required to update your centralised git repo with the results of the build).

Now, developers should never commit directly to your integration branch (the 'master' or 'stable'). Instead, they should either use feature branches, or create new remote branches on commit (e.g : "git push origin HEAD:refs/heads/myNewFeature"). You could also set up your GIT repository to only accept commits onto the integration branch from Jenkins.

You're done. Commits should now be automatically merged with the integration branch (they will fail if they do not merge cleanly), and built. If the build succeeds, the result of the merge will be pushed back to the remote git repository.

Using Extra Repositories

Since GIT is a Distributed SCM, it is possible in the Advanced section to specify multiple repositories. You may wish to do this to, for example, pull all in-progress work from individual developers machines, and pre-test them before they are committed to a centralised repository - this way developers may get an early warning that a branch in progress may not be stable.

The GIT plugin will make reasonable attempts to try and pull submodule states from distributed repositories, with the proviso that this feature is not currently well supported within GIT itself.

Autogenerate submodule configurations

A common development pattern for many users is the use of a 'superproject' that aggregates a number of submodules. For example, ProjectA may have ComponentA, ComponentB and ComponentC. ComponentA is a shared library, and is set to use a particular revision (maybe on a branch called 'ProjectA' in case there are any changes). Usually, any changes to the project configuration require a commit to the ProjectA superproject.

However - there could be other changes happening on other branches of ComponentA (say to the development of the next version). Without someone generating commits into ProjectA to test these, any regressions or incompatibilities may be missed.

The autogenerate submodule configurations feature will create commits into ProjectA for all possible combinations of the branches present in the submodules that the project uses.

Recursive submodules

The GIT plugin supports repositories with submodules which in turn have submodules themselves. This must be turned on though: in Job Configuration -> Section Source Code Management, Git -> Advanced Button (under Branches to build) -> Recursively update submodules.

Environment variables

The git plugin sets several environment variables you can use in your scripts:

  • GIT_COMMIT - SHA of the current
  • GIT_BRANCH - Name of the branch currently being used, e.g. "master" or "origin/foo"
  • GIT_PREVIOUS_COMMIT - SHA of the previous built commit from the same branch (the current SHA on first build in branch)
  • GIT_URL - Repository remote URL
  • GIT_URL_N - Repository remote URLs when there are more than 1 remotes, e.g. GIT_URL_1, GIT_URL_2
  • GIT_AUTHOR_EMAIL - Committer/Author Email
  • GIT_COMMITTER_EMAIL - Committer/Author Email

Changelog

Also see long term plan

Version 2.2.1 (Apr 12, 2014)

  •   Allow clean before checkout (issue #22510)
  •   Do not append trailing slash to most repository browser URL's (issue #22342)
  •   Fix null pointer exception in git polling with inverse build chooser (issue #22053)

Version 2.2.0 (Apr 4, 2014)

  •   Add optional submodule remote tracking if git version newer than 1.8.2 (issue #19468)
  •   Update to JGit 3.3.1
  •   Fix javadoc warnings

Version 2.1.0 (Mar 31, 2014)

  •   support sparse checkout if git version newer than 1.8.2 (issue #21809)
  •   improve performance when many branches are in the repository (issue #5724)
  •   retain git browser URL when saving job configuration (issue #22064)
  •   resolve tags which contain slashes (issue #21952)

Version 2.0.4 (??? ??, 2014)

  •   ??? (tbd)

Version 2.0.3 (Feb 21, 2014)

Version 2.0.2 (Feb 20, 2014)

  •   option to configure timeout on major git operations (clone, fetch)
  •   locks are considered a retryable failure
  •   notifyCommit now accept a sha1 - make commit hook design simpler and more efficient (no poll required)
  •   extend branch specifier (issue #17417) and git repository URL
  •  Better support for branches with "/" in name (issue #14026)
  •  Improve backward compatibility (issue #20861)

Version 2.0.1 (Jan 8, 2014)

  •  Use git-credentials-store so http credentials don't appear in workspace (issue #20318)
  •  Prune branch during fetch (issue #20258)
  •  Fix migration for 1.x skiptag option (issue #20561)
  •  Enforce Refsepc configuration after clone (issue #20502)

Version 2.0 (Oct 22, 2013) - just in time for JUC :P

  •  Refactored git plugin for UI to keep clean. Most exotic features now are isolated in Extensions, that is the recommended way to introduce new features
  •  Introduce support for credentials (both ssh and username/password) based on credentials plugin

Version 1.5.0 (Aug 28, 2013)

  • Additional environmental values available to git notes
  • Extension point for other plugin to receive commit notifications
  • Support promoted builds plugin (passing GitRevisionParameter)
  • Do not re-use last build's environment for remote polling (issue #14321)
  • Fixed variable expansion during polling (issue #7411)
  • Added Phabricator and Kiln Harmony repository browsers, fixed GitLab URLs

Version 1.4.0 (May 13, 2013)

  •  Avoid spaces in tag name, rejected by JGit (issue #17195)
  •  Force UTF-8 encoding to read changelog file (issue #6203)
  •  Retry build if SCM retry is configured (issue #14575)
  •  Allow merge results to push from slave nodes, not just from master node (issue #16941)

Version 1.3.0 (March 12, 2013)

  • Fix a regression fetching from multiple remote repositories (issue #16914)
  • Fix stackoverflow recursive invocation error caused by MailAddressResolver (issue #16849)
  • Fix invalid id computing merge changelog (issue #16888)
  • Fix lock on repository files (issue #12188)
  • use default git installation if none matches (issue #17013).
  • Expand reference parameter when set with variables
  • Expose GIT_URL environment variable (issue #16684)
  • Branch can be set by a regexp, starting with a colon (pull request #138)

Version 1.2.0 (February 20, 2013)

  • move git client related stuff into Git Client plugin
  • double checked backward compatibility with gerrit, git-parameter and cloudbees validated-merge plugins.

Version 1.1.29 (February 17, 2013)

  • fix a regression that breaks jenkins remoting
  • restore BuildChooser API signature, that introduced issue #16851

Version 1.1.27 (February 17, 2013)

  • add version field to support new GitLab URL-scheme
  • Trim branch name - a valid branch name does not begin or end with whitespace. (issue #15235)
  • set changeSet.kind to "git"
  • Avoid some calls to "git show"
  • Fix checking for an email address (issue #16453)
  • update Git logo icon
  • Pass combineCommits to action (issue #15160)
  • expose previous built commit from same branch as GIT_PREVIOUS_COMMIT
  • re-schedule project when multiple candidate revisions are left
  • expand parameters in the remote branch name of merge options
GitAPI cleanup

Long term plan is to replace GitAPI cli-based implementation with a pure java (JGit) one, so that plugin is not system dependent.

  • move git-plugin specific logic in GitSCM, have GitAPI implementation handle git client stuff only
  • removed unused methods
  • create unit test suite for GitAPI
  • create alternate GitAPI implementation based on JGit

Version 1.1.26 (November 13, 2012)

  • git polling mechanism can have build in infinite loop (issue #15803)

Version 1.1.25 (October 13, 2012)

  • Do "git reset" when we do "git clean" on git submodules (pull #100)
  • NullPointerException during tag publishing (issue #15391)
  • Adds RhodeCode support (issue #15420)
  • Improved the BuildChooser extension point for other plugins.

Version 1.1.24 (September 27, 2012)

  • Shorten build data display name issue #15048
  • Use correct refspec when fetching submodules issue #8149
  • Allow a message to be associated with a tag created by the plugin

Version 1.1.23 (September 3, 2012)

  • Improve changelog parsing for merge targets
  • prevent process to hang when git waits for user to interactively provide credentials
  • option to create a shallow clone to reduce network usage cloning large git repositories
  • option to use committer/author email as ID in jenkins user database when parsing changelog (needed for openID / SSO integration)
  • validate repository URL on job configuration

Version 1.1.22 (August 8, 2012)

  • Fix regression for fully qualified branch name (REPOSITORY/BRANCH) issue #14480
  • Add support for variable expansion on branch spec (not just job parameters) issue #8563
  • Use master environment, not last build node, for fast remote polling issue #14321
  • run reset --hard on clean to take care of any local artifact
  • normalize maven repository ID issue #14443

Version 1.1.21 (July 10, 2012)

  • Fixed support for "/" in branches names (issue #14026)
  • Fixed issue on windows+msysgit to escape "^" on git command line (issue #13007)

Version 1.1.20 (June 25, 2012)

Version 1.1.19 (June 8, 2012)

  • restore GitAPI constructor for backward compatibility (issue #12025)
  • CGit browser support (issue #6963).
  • Handle special meaning of some charactes on Windows (issue #13007)
  • fixed java.lang.NoSuchMethodError: java/lang/String.isEmpty() (issue #13993).
  • Git icon(git-48x48.png) missing in job page. (issue #13413).
  • Git "Tag to push" should trim whitespace (issue #13550).

Version 1.1.18 (released April 27, 2012)

  • Loosened the repository matching algorithm for the push notification to better work with a repository with multiple access protocols.

Version 1.1.17 (released April 9, 2012)

  • Fixed NPE in compareRemoteRevisionWith (issue #10880)
  • Improved the caching of static resources
  • notifyCommit endpoint now accept a comma delimited list of affected branches. Only the build(s) that match those branches will be triggered

Version 1.1.16 (released February 28, 2012)

Version 1.1.15 (released December 27, 2011)

  • Fixed a bug where the push notification didn't work with read-protected projects. (issue #12022)
  • Improved the handling of disabled projects in the push notification.

Version 1.1.14 (released November 30, 2011)

Version 1.1.13 (released November 24, 2011)

  • option to ignore submodules completely (issue #6658)
  • support FishEye scm browser (issue #7849)
  • inverse choosing strategy to select all branches except for those specified (pull request #45)
  • option to clone from a reference repository
  • fix databinding bug (issue #9914)
  • action to tag a build, similar to subversion plugin feature

Version 1.1.12 (released August 5, 2011)

  • When choosing the branch to build, Jenkins will pick up the oldest branch to induce fairness in the scheduling. (it looks at the timestamp of the tip of the branch.)
  • Git now polls without needing a workspace (issue #10131)
  • Fixed the "no remote from branch name" problem (issue #10060)

Version 1.1.11 (released July 22, 2011)

Version 1.1.10 (released July 15, 2011)

  • Merge options persist properly now. (issue #10270)
  • Fixed NPE in PreBuildMergeOptions when using REST API. (issue #9843)
  • Global config name/email handle whitespace properly. (issue #10272, issue #9566)
  • Improved memory handling of "git whatchanged". (issue #8365)
  • Excluded regions should now work with multiple commit changesets. (issue #8342)
  • ViewGit support added. (issue #5163)
  • Fixed NPE when validating remote for publisher. (issue #9971)
  • Tool selection persists now. (issue #9765)
  • Remote branch pruning now happens after fetch, to make sure all remotes are defined. (issue #10348)

Version 1.1.9 (released May 16, 2011)

  • Don't strip off interesting stuff from branch names in token macro (issue #9510)
  • Changes to serialization to support working with the MultiSCM plugin and general cleanliness. (github pull request)
  • Check to be sure remote actually exists in local repo before running "git remote prune" against it. (issue #9661)
  • Eliminate a problem with NPEs on git config user.name/user.email usage on upgrades. (issue #9702)
  • Add a check for git executable version as 1.7 or greater before using --progress on git clone calls. (issue #9635)

Version 1.1.8 (released May 6, 2011)

  • Re-release of 1.1.7 to deal with forked version of plugin having already released with same groupId/artifactId/version as our 1.1.7 release, thereby breaking things.

Version 1.1.7 (released May 4, 2011)

  • GIT_COMMIT environment variable now available in builds. (issue #9253)
  • Improved wording of error message when no revision is found to build. (issue #9339)
  • Added "--progress" to git clone call. (issue #9168)
  • Underlying error actually shown when git fetch fails. (issue #9052)
  • git config options for user.name and user.email now save properly. (issue #9071)
  • Properly handle empty string for branch when branch is parameterized. (issue #8656)
  • If no Jenkins user is found for a commit's user.name value, strip the username from "username@domain.com" from the user.email value and use that instead. (issue #9016)

Version 1.1.6 (released Mar 8, 2011)

  • Fix for warning stacktrace if paramaterized trigger plugin was not installed.
  • No longer try to generate complete history as changelog if previous build's SHA1 no longer exists in repository. (issue #8853)
  • Fixed bug causing "Firstname Lastname@domain.com" to be used as email address for users. (issue #7156)
  • Passwords should now be properly used in https URLs. (issue #3807)
  • Exposed a few token macros

Version 1.1.5 (released Feb 14, 2011)

  • Added an extension for Parameterized Trigger Plugin to allow Git SHA1 of the current build to be passed to downstream builds (so that they can act on the exact same commit.)
  • Allowed optional disabling of internal tagging (issue #5676)
  • If specified, use configured values for user.email and user.name (issue #2754)
  • Removed obsolete/unused wipe out workspace option and defunct Gerrit build chooser.
  • Rebranded to Jenkins!

Version 1.1.4 (released December 4, 2010)

  • For Matrix projects, push only at the end of the whole thing, not at the configuration build (issue #5005).
  • Switching between browsers does not function properly (issue #8210).
  • Implement support for Redmine as browser.

Version 1.1.3 (released November 8, 2010)

  • No changes except of updated version according to scm.

Version 1.1.2 (released November 8, 2010)

Version 1.1.1 (released November 5, 2010)

  • Improved logging for failures with git fetch.
  • Made sure .gitmodules is closed properly. (issue #7659)
  • Fixed issue with polling failing if the master has 0 executors. (issue #7547)
  • Modified Git publisher to run as late as possible in the post-build plugin order. (issue #7877)
  • Added optional call to "git remote prune" to prune obsolete local branches before build. (issue #7831)

Version 1.1 (released September 21, 2010)

  • Added ability for GitPublisher to only push if build succeeds. (issue #7176)
  • Fixed major bug with submodule behavior - making sure we don't try to fetch submodules until we've finished the initial clone. (issue #7258)
  • "Clean after checkout" wasn't invoked when pre-build merges were enabled. (issue #7276)
  • Form validation was missing for the GitPublisher tag and branch names, and an empty value was allowed for GitPublisher target repositories, leading to confusion. (issue #7277)
  • "Clean before build" will now run in submodules as well as root. (issue #7376)
  • When polling, Hudson-configured environment variables were not being used. (issue #7411)
  • Modifications to BuildData to deal with Hudson no longer serializing null keys. (issue #7446)
  • Support for --recursive option to submodule commands. (issue #6258)

Version 1.0.1 (released August 9, 2010)

  • Fixed submodules support - was broken by issue #6902 fix. (issue #7141)
  • Switched "Recent Changes" list for a project to count changes per build, rather than using revision as if it were a number. (issue #7154)
  • Stopped putting problematic slash at end of GitWeb URL. (issue #7020)

Version 1.0 (released July 29, 2010)

  • Added support for Github as a repository browser.
  • Added support for optionally putting source in a subdirectory of the workspace (issue #6357)
  • If all repository fetches fail, fail the build. (issue #6902)
  • Improved logging of git command execution errors (issue #6330)
  • Basic support for excluded regions and excluded users in polling added (issue #4556)
  • Support for optionally checking out to a local branch, rather than detached HEAD (issue #6856)
  • Revamped GitPublisher to allow for pushing tags to remotes and pushing to remote branches, as well as existing push of merge results. (issue #5371)

Version 0.9.2 (released June 22, 2010)

  • Fixed major bug in BuildChooser default selection and serialization (issue #6827)

Version 0.9.1 (released June 22, 2010)

  • Dramatic improvement in changelog generation, thanks to a switch to use "git whatchanged" (issue #6781)

Version 0.9 (released June 17, 2010)

  • Improved support for BuildChooser as an extension point - other plugins can now implement their own BuildChoosers and have them automatically show up as an option in Git configuration when installed.
  • Options added for wiping out the workspace before the build begins (this option may be removed), and for using commit authors as the Hudson changelog entry author, rather than the committers, the default behavior.

Version 0.8.2

  • Support for Gerrit plugin.
  • Support for different build choosers.

Version 0.7.3

FIXME this changelog entry is incomplete! Please give me some love!

  • Fixed issue #2931, git tag freezing job execution (jbq)
  • Improve log messages (jbq)
  • Use build listener to report messages when pushing tags to origin (jbq)
  • Fixed issue #2762, fail to clone a repository on Windows (jbq)

Version 0.5

  • Fix git plugin which was very broken when running on a remote server (magnayn)
  • Fix NPE in GitChangeLogParser upon project's first build (jbq)
  • Change workspace to a FilePath in GitAPI (jbq)
  • Use git rev-list once instead of invoking git rev-parse indefinitely to find last build, see issue #2469: GIT plugin very slow (jbq)
  • Handle null-value of the repositories field to ensure backwards-compatibility with version 0.3,
    ie when the project configuration is missing the <repositories/> XML element (jbq)
  • Improve error handling in revParse() (jbq)
  • Fix handling of the "branch" configuration parameter (jbq)
  • Improve tag handling, use show-ref instead of rev-parse to resolve the tag reference (jbq)
  • Fix issue #2675, Git fails on remote slaves (jbq)

Version 0.4 (never released)

  • Allow multiple GIT repositories to be specified (magnayn)
  • Allow submodule configurations to be generated on the fly (magnayn)
  • Avoid infinite loops when git doesn't contains tags (david_calavera)
  • Don't do a log of the entire branch if it's never been built (magnayn)

Version 0.3

  • Add support for pre-build branch merges

Version 0.2

  • Improve handling of git repositories (use local tags to identify up to date versions rather than the wc HEAD)
  • Don't have to specify a branch, in which case all branches are examined for changes and built
  • Includes a publisher which can be used to push build success/failure tags back up to the upstream repository

Version 0.1

  • Initial Release

Labels

plugin-scm plugin-scm Delete
token-producer token-producer Delete
parameterized-trigger-contributer parameterized-trigger-contributer Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jun 23, 2009

    Kohsuke Kawaguchi says:

    Through rtyler: http://github.com/stephenh/git-central/blob/master/server/post-r...

    Through rtyler: http://github.com/stephenh/git-central/blob/master/server/post-receive-hudson automates the set up of a Hudson job whenever a new branch is created. Nice.

  2. Jul 22, 2009

    jlongman - says:

    How do I build a specific revision? I used to be able to specify a build should ...

    How do I build a specific revision? I used to be able to specify a build should use SHA1-ID, like build origin/bdbbfc3f0e9c57fbeff89de2ad7ca308a168575e and it would work.  This is necessary for reproducibility.

    Has this changed? How do I do this now?

  3. Nov 17, 2009

    Kenneth P. Turvey says:

    I wrote a tutorial on getting hudson to work with git and grails.  It inclu...

    I wrote a tutorial on getting hudson to work with git and grails.  It includes all the information necessary to set up an integration server using git and hudson even if you aren't interested in grails development:

    http://www.electricsenator.net/2009/10/03/1254618530821.html

    1. Mar 24, 2011

      anthony dass says:

      I would be very much interested in this tutorial but this link does't ...

      I would be very much interested in this tutorial but this link does't seems to work, do you have any alternate link? Thanks!

  4. Nov 18, 2009

    Graeme Simpson says:

    Is it possible to use credentials when accessing a git repository? Or certificat...

    Is it possible to use credentials when accessing a git repository? Or certificates?

    Thanks,
    Graeme

  5. Jan 01, 2010

    cemerick - says:

    Is there any way to get the git plugin to checkout ref names instead of the sha'...

    Is there any way to get the git plugin to checkout ref names instead of the sha's associated with remote refs? Not being on a branch in the course of a build is causing issues (for at least two of us) in conjunction with the M2 Release Plugin:

    Can’t get automated release working with Hudson + Git + Maven Release Plugin

    1. Feb 02, 2010

      cemerick - says:

      This issue has been resolved for me as of v0.8.0 of the git plugin.  See my...

      This issue has been resolved for me as of v0.8.0 of the git plugin.  See my comment below.

      1. Mar 17, 2010

        David Antliff says:

        Really? I'm using 0.8 (by using the Hudson plugin upgrader) and still seeing Hud...

        Really? I'm using 0.8 (by using the Hudson plugin upgrader) and still seeing Hudson check out a specific SHA-1 rather than a reference:

        [workspace] $ git checkout -f 2904dc785ef11727aab604b2119bfbb4341a24bc
        

        even though I specified "origin/myBranch" in the Branch Specifier field. This detaches HEAD and makes it impossible (or very hard at least) for a subsequent build script to know what branch it's building on.

  6. Jan 06, 2010

    Brad Robertson says:

    I can't get Hudson to merge into the master branch. It always ends up in *no br...

    I can't get Hudson to merge into the master branch. It always ends up in *no branch, which is no good to me as I want to push master to another remote repo as a deploy.
    I've set the following:
    refspec: +refs/heads/master:refs/remotes/origin/master
    branch to build: */master
    branch to merge to: master

    The Git logs show it fetching the latest, then for some reason checking out the previous version with the sha, which puts it into *no branch. Then it does a git merge with the latest, still on *no branch. I've included the logs below.

    I don't think this is the correct behavior given that I specify that I want to merge to the master branch. Thoughts? Bug?

    Git logs from hudson:
    git fetch /home/git/repositories/my_repo.git +refs/heads/master:refs/remotes/origin/master
    git ls-tree HEAD
    git rev-parse master
    git checkout -f old_rev_sha here's where it switches branches
    git merge new_rev_sha

    1. Jan 08, 2010

      cemerick - says:

      I don't know if this is a bug, but +1 that this isn't correct behaviour IMO (see...

      I don't know if this is a bug, but +1 that this isn't correct behaviour IMO (see my comment directly above yours).

      1. Jan 09, 2010

        Brad Robertson says:

        ya i read that. I'm also confused as to why it's using sha's, especially when t...

        ya i read that. I'm also confused as to why it's using sha's, especially when the plugin allows you to specify the ref you want and the branch to merge to.

        I personally do think it's a bug if you are specifying the branch to merge to and the fetched code is not merged to that branch

        1. Feb 02, 2010

          cemerick - says:

          I upgraded to v0.8.0 of the git plugin, and have been able to perform a maven re...

          I upgraded to v0.8.0 of the git plugin, and have been able to perform a maven release using the Maven release plugin, and have the results successfully pushed back to master.

          v0.8.0 appears to add a "Merge options" section (in the advanced tab under the SCM section of the project config).  I put "origin" in 'name of repository' and "master" in 'branch to merge to', and the push went swimmingly.

          1. Feb 11, 2010

            Brad Robertson says:

            Merge options were definitely available in 0.73. I mentioned above that I put i...

            Merge options were definitely available in 0.73. I mentioned above that I put in "master" as "branch to merge to" in my settings and it still didn't work. I haven't upgraded to 0.8 though so I'll check it out when I get a chance. I don't know how this can't be documented anywhere though.

            1. Mar 16, 2010

              David Antliff says:

              Brad: did you have any success with 0.8 in this respect? I'm seeing Hudson conti...

              Brad: did you have any success with 0.8 in this respect? I'm seeing Hudson continue to check out the specific SHA rather than the branch reference, and therefore detach the HEAD.

              1. Mar 17, 2010

                Brad Robertson says:

                To be honest, I haven't looked at this in quite some time, i'm working on a few ...

                To be honest, I haven't looked at this in quite some time, i'm working on a few projects so i've been fairly busy. I'll keep you posted when I find the time to see if this has been fixed for me.

  7. Jan 11, 2010

    anonymousultimo - says:

    Problems with new 0.8 version under windows. It looks very good and the new inf...

    Problems with new 0.8 version under windows.

    It looks very good and the new information about changed files is great but scm polling doesn't work anymore

    1. Feb 08, 2010

      jlongman - says:

      I'm also having problems, but I'm not using windows: Feb 8, 2010 11:51:03 AM h...

      I'm also having problems, but I'm not using windows:

      Feb 8, 2010 11:51:03 AM hudson.triggers.SCMTrigger$Runner runPolling
      SEVERE: Failed to record SCM polling
      java.lang.NullPointerException
      	at hudson.plugins.git.GitSCM.pollChanges(GitSCM.java:254)
      	at hudson.model.AbstractProject.pollSCMChanges(AbstractProject.java:1067)
      	at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:319)
      	at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:346)
      	at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      	at java.lang.Thread.run(Thread.java:619)
      
      Solved by adding executors to my master
  8. Mar 16, 2010

    David Antliff says:

    Is there an inconsistency here? This page says 0.8 is the Latest Release, but th...

    Is there an inconsistency here? This page says 0.8 is the Latest Release, but the download link to the .hpi file is pointing at 0.7.3.

    What is the download link to the 0.8 hpi please, as I need to archive this file for static installation at my site.

  9. Mar 27, 2010

    Evgeny Goldin says:

    Hi, I have a problem with latest Hudson v1.352 and Git plugin v0.8.1. After fet...

    Hi,

    I have a problem with latest Hudson v1.352 and Git plugin v0.8.1.
    After fetching successfully Git sources - Maven fails with NPE

    java.lang.NullPointerException
    	at java.util.Hashtable.put(Hashtable.java:394)
    	at java.util.Hashtable.putAll(Hashtable.java:466)
    	at hudson.maven.MavenBuilder.call(MavenBuilder.java:156)
    	at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:688)
    	at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:632)
    	at hudson.remoting.UserRequest.perform(UserRequest.java:114)
    	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    	at hudson.remoting.Request$2.run(Request.java:270)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    	at java.lang.Thread.run(Thread.java:619)
    

    Here's the full log and job's configuration

    Git plugin passes null value for GIT_BRANCH environment variable,
    which later fails in MavenBuilder.java:156 when Maven plugin calls
    System.getProperties().putAll(systemProps)

    Here's a debugger screenshot.

    1. Mar 27, 2010

      Evgeny Goldin says:

      Fixed it by specifying "master" as default branch, not empty and not "**...

      Fixed it by specifying "master" as default branch, not empty and not "**".
      Posted it in my blog as well.

  10. Apr 02, 2010

    Mark Moore says:

    I'm hoping this is the right place to post this question...  It looks like ...

    I'm hoping this is the right place to post this question...  It looks like the Git plugin simply issues a git fetch origin master (or something reasonably similar).  I want to force a clean before fetching.  specifically "git -fx clean"  Does anyone know how to make this happen?  I could add this to the build commands, but that seems a little wrong.

    Help!

    -Mark

    1. Apr 02, 2010

      David Antliff says:

      What we do is issue the 'git clean' command as one of the first things the build...

      What we do is issue the 'git clean' command as one of the first things the build script (stored within the repository) executes. You could add it to the build command list if you wanted to, I don't think it's wrong. Hudson is just responsible for cloning/updating.

      I just wish it checked out a ref instead of a commit, or at least set an environment variable to the specified branch name :)

  11. May 06, 2010

    Mik Lernout says:

    This page should probably mention that the Git plugin relies on a recent version...

    This page should probably mention that the Git plugin relies on a recent version of the Git binaries (at least 1.7?).

  12. Jun 15, 2010

    Ian Eure says:

    Same problem here with builds always starting from a detached HEAD. I'm using th...

    Same problem here with builds always starting from a detached HEAD. I'm using the most recent version of the plugin, 0.8.3.

    My config is:

    URL of repository: git://github.com/simplegeo/libmemcached.git
    Name of repository: origin
    Refspec: +refs/heads/*:refs/remotes/origin/*
    
    Branches to build: master
    
    Merge before build: Yes
    Name of repository: origin
    Branch to merge to: master
    
    Clean after checkout: Yes
    Choosing strategy: Default
    Repository browser: (Auto)
    

    These are the git commands that get run:

    Checkout:libmemcached-test / /home/pubhudsonslave/workspace/libmemcached-test - hudson.remoting.Channel@581ea2:pubhudsonslave
    Using strategy: Default
    Last Built Revision: Revision 13e70eabe93822d0ce7fceee6ebcbbd490b19a76 (origin/master)
    Checkout:libmemcached-test / /home/pubhudsonslave/workspace/libmemcached-test - hudson.remoting.LocalChannel@135c7da7
    GitAPI created
    Fetching changes from the remote Git repository
    Fetching upstream changes from git://github.com/simplegeo/libmemcached.git
    [libmemcached-test] $ git fetch -t git://github.com/simplegeo/libmemcached.git +refs/heads/*:refs/remotes/origin/*
    [libmemcached-test] $ git ls-tree HEAD
    [libmemcached-test] $ git tag -l master
    [libmemcached-test] $ git rev-parse origin/master
    Commencing build of Revision 13e70eabe93822d0ce7fceee6ebcbbd490b19a76 (origin/master)
    GitAPI created
    Checking out Revision 13e70eabe93822d0ce7fceee6ebcbbd490b19a76 (origin/master)
    [libmemcached-test] $ git checkout -f 13e70eabe93822d0ce7fceee6ebcbbd490b19a76
    [libmemcached-test] $ git tag -a -f -m "Hudson Build #7" hudson-libmemcached-test-7
    Recording changes in branch origin/master
    [libmemcached-test] $ git log --pretty=format:%H 13e70eabe93822d0ce7fceee6ebcbbd490b19a76..13e70eabe93822d0ce7fceee6ebcbbd490b19a76
    Cleaning workspace
    [libmemcached-test] $ git clean -fdx
    Finished: SUCCESS
    

    It's not merging anything, and it's still checking out a SHA-1 instead of a symbolic branch name. What gives?

  13. Jun 18, 2010

    Alexander Sparkowsky says:

    I'm trying to figure out how the tags generated by the plugin for each build are...

    I'm trying to figure out how the tags generated by the plugin for each build are pushed back to the origin repository.

    The text above mentions an option called 'Push GIT tags back to origin repository' but I'm not able to find it.

    So how do I get the plugin pushing the tags for each build to the upstream repo?

  14. Jun 25, 2010

    ITDude says:

    Folks, I'm experiencing problems setting up the GIT Plugin on a Debian system us...

    Folks, I'm experiencing problems setting up the GIT Plugin on a Debian system using a SSH key for authentication and was hoping somebody has had some experience with this setup who could offer some pointers.

    I believe the problem is that it fails to find the key and thus present it to the GIT server. I've installed a valid key into the /usr/share/tomcat5.5/.ssh directory which is the home of the tomcat55 user but it fails with a ssh-askpass error.

    Now I'm guessing that the process is running as the tomcat55 user but I could be wrong as looking at the logs below you can see that it is attempting to fetch to the /home/hudson directory. What's confusing about this is that the system does not have a user 'hudson' and in the System Information section of the web interface the enveronment looks as though it's running as the root user.

    Here's the log output;

    ------------------
    Started by user ITDude
    Checkout:workspace / /home/hudson/jobs/TestHudson/workspace - hudson.remoting.LocalChannel@f74f6ef
    Using strategy: Default
    Checkout:workspace / /home/hudson/jobs/TestHudson/workspace - hudson.remoting.LocalChannel@f74f6ef
    GitAPI created
    Fetching changes from the remote Git repository
    Fetching upstream changes from git@git.mycomp.com:test_hudson.git
    [workspace] $ /usr/bin/git fetch -t git@git.mycomp.com:test_hudson.git +refs/heads/:refs/remotes/origin/
    No protocol specified

    (ssh-askpass:13369): Gtk-WARNING **: cannot open display: :0.0
    Permission denied, please try again.
    No protocol specified

    (ssh-askpass:13370): Gtk-WARNING **: cannot open display: :0.0
    Permission denied, please try again.
    No protocol specified

    (ssh-askpass:13371): Gtk-WARNING **: cannot open display: :0.0
    Permission denied (publickey,password).
    fatal: The remote end hung up unexpectedly
    ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
    ERROR: Nothing to do
    Finished: FAILURE
    ========================

    The key is definitely valid as I've tested it with a manual connection.

  15. Jun 25, 2010

    Dale Hards says:

    Hello, I'm having difficulties getting the git plugin to fetch from the reposit...

    Hello,

    I'm having difficulties getting the git plugin to fetch from the repository. In the job's configuration I have provided:

    URL of repository: git@git.mydomain.com:test_hudson.git

    • which as far as I know is correct.

    Name of repository: origin/master

    • I have two choices. My repository is remote and according to Git Extensions on my Windows machine where I am pushing code to the central repository the repository is either origin/HEAD or origin/master - I have tried both.

    Refspec: I leave this blank and it generates the following: +refs/heads/:refs/remotes/origin/master/

    I have also provided the Branches to build: master

    I have tried many different combinations of settings, and each one gives a different error message, but none of them are ever getting to the point where Ant builds my simple Java project. On the above settings, I get the following log:

    ***

    Started by user daleh
    Checkout:workspace / /home/hudson/jobs/TestHudson/workspace - hudson.remoting.LocalChannel@3219ab8d
    Using strategy: Default
    Checkout:workspace / /home/hudson/jobs/TestHudson/workspace - hudson.remoting.LocalChannel@3219ab8d
    GitAPI created
    Fetching changes from the remote Git repository
    Fetching upstream changes from git@git.mydomain.com:test_hudson.git
    [workspace] $ /usr/bin/git fetch -t git@git.mydomain.com:test_hudson.git +refs/heads/:refs/remotes/origin/master/
    error: unable to resolve reference refs/remotes/origin/master/master: Not a directory
    From git@git.mydomain.com:test_hudson
    ! [new branch] master -> origin/master/master (unable to update local ref)
    error: some local refs could not be updated; try running
    'git remote prune git@git.mydomain.com:test_hudson.git' to remove any old, conflicting branches
    ERROR: Problem fetching from origin/master / origin/master - could be unavailable. Continuing anyway
    [workspace] $ /usr/bin/git tag -l master
    [workspace] $ /usr/bin/git rev-parse origin/master/master
    ERROR: Nothing to do
    Finished: FAILURE

    ***

    As for needing to remove any "old conflicting branches", I have none. This is a simple project with no conflicting branches.

    Thanks in advance for any help provided

    1. Jun 27, 2010

      Dale Hards says:

      This has now been resolved through the mailing list. The problem was that origin...

      This has now been resolved through the mailing list. The problem was that origin/master is a branch not a repository. I needed to leave the repository blank (letting it be automatically set as "origin"), and supplying "origin/master" in the "build branch" setting. This fixed the problem fine.

  16. Jul 13, 2010

    Adam Szecowka says:

    Hello, I have repoA and repoB, and i want clone repoA to directory for example w...

    Hello,
    I have repoA and repoB, and i want clone repoA to directory for example workspace/myJob/A and clone repoB to workspace/myJob/B. Is it possible with this plugin ?

    1. Mar 31, 2011

      Daniel Blah says:

      I have the same situation as Adam. We need to be able to clone two separate repo...

      I have the same situation as Adam. We need to be able to clone two separate repos side-by-side in the workspace - the same way we can do so with the Jenkins SVN plugin. This plugin appears to try cloning both repos into the same directory. Is there any way to do this??

      The "Advanced" button at the bottom of the Git section in the build configuration reveals an option for "Local subdirectory for repo (optional)" but it's not specific to a defined repo. I'm not sure how this makes sense to have as a "global" option when you can specify multiple repos.

      Anyone have any ideas?

      UPDATE: This is being tracked in JENKINS-8082, which should be a feature request I'm guessing

      1. Sep 06, 2013

        star latch says:

        Try using Multiple SCMs plugin
  17. Jul 26, 2010

    Dave Abrahams says:

    Having Serious Submodule Problems. I confess that I don't understand what the d...

    Having Serious Submodule Problems. I confess that I don't understand what the documentation above about automatic submodule handling is trying to convey about what Hudson is doing, but whatever it is, it seems to be wrong. I'm content to do the git submodule init / git submodule update myself if necessary. Log below; can you please help? Thanks!

    Started by user dave
    Checkout:workspace / /var/lib/hudson/jobs/Boost/workspace - hudson.remoting.LocalChannel@3faa7a6a
    Using strategy: Default
    Last Built Revision: Revision 9fc9270750b81ec49fb96ee7b37fde5547da67c7 (origin/master)
    Checkout:workspace / /var/lib/hudson/jobs/Boost/workspace - hudson.remoting.LocalChannel@3faa7a6a
    GitAPI created
    Cloning the remote Git repository
    Cloning repository origin
    $ git clone -o origin git://gitorious.org/ryppl/boost.git /var/lib/hudson/jobs/Boost/workspace
    Fetching upstream changes from git://gitorious.org/ryppl/boost.git
    [workspace] $ git fetch -t git://gitorious.org/ryppl/boost.git +refs/heads/:refs/remotes/origin/
    [workspace] $ git ls-tree HEAD
    GitAPI created
    Fetching upstream changes from git://gitorious.org/ryppl/boost.git/cmake/.git
    [cmake] $ git fetch -t git://gitorious.org/ryppl/boost.git/cmake/.git +refs/heads/:refs/remotes/origin/
    fatal: protocol error: expected sha/ref, got '
    ----------------------------------------------
    Cannot find repository /ryppl/boost.git/cmake/.git
    ----------------------------------------------'
    ERROR: Problem fetching from origin - could be unavailable. Continuing anyway
    [workspace] $ git submodule init
    [workspace] $ git submodule update
    [workspace] $ git tag -l master
    [workspace] $ git rev-parse origin/master
    Commencing build of Revision 9fc9270750b81ec49fb96ee7b37fde5547da67c7 (origin/master)
    GitAPI created
    Checking out Revision 9fc9270750b81ec49fb96ee7b37fde5547da67c7 (origin/master)
    [workspace] $ git checkout -f 9fc9270750b81ec49fb96ee7b37fde5547da67c7
    [workspace] $ git submodule init
    [workspace] $ git submodule sync
    Fetching upstream changes from git://gitorious.org/ryppl/boost.git
    [workspace] $ git fetch -t git://gitorious.org/ryppl/boost.git +refs/heads/:refs/remotes/origin/
    [workspace] $ git ls-tree HEAD
    GitAPI created
    Fetching upstream changes from git://gitorious.org/ryppl/boost.git/cmake/.git
    [cmake] $ git fetch -t git://gitorious.org/ryppl/boost.git/cmake/.git +refs/heads/:refs/remotes/origin/
    fatal: protocol error: expected sha/ref, got '
    ----------------------------------------------
    Cannot find repository /ryppl/boost.git/cmake/.git
    ----------------------------------------------'
    ERROR: Problem fetching from origin - could be unavailable. Continuing anyway
    [workspace] $ git submodule update
    [workspace] $ git tag -a -f -m "Hudson Build #4" hudson-Boost-4
    Recording changes in branch origin/master
    [workspace] $ git whatchanged --no-abbrev -M --pretty=raw 9fc9270750b81ec49fb96ee7b37fde5547da67c7..9fc9270750b81ec49fb96ee7b37fde5547da67c7
    Triggering default
    Finished: FAILURE

    1. Aug 06, 2010

      Vincent Driessen says:

      The error occurs directly after the "git ls-tree HEAD" command. Assuming a defau...

      The error occurs directly after the "git ls-tree HEAD" command. Assuming a default Git repo setup, HEAD refers to "master" at that stage. I think the output of that process is scanned and each entry that has mode flag 160000 (= submodule commit) is filtered out and processed accordingly.

      How it detects and fetches from the submodule URL? I have no clue at all, but I know it's wrong.

      Furthermore, I have a branch called "develop" that does NOT have a submodule commit, but my master does. Even it I configure a Hudson job to fetch from branch "develop", it still uses "git ls-tree HEAD" to scan/parse for submodules, before switching to "develop", also breaking those builds. I've filed this as a bug on the Git plugin issue list (see http://github.com/magnayn/Hudson-GIT-plugin/issues#issue/4).

  18. Aug 25, 2010

    Miraj Hasnaine Tafsir says:

    There is no included region feature for GIT. If there are some few regions to be...

    There is no included region feature for GIT. If there are some few regions to be participated in the build I think its not a good idea to have so many excluded regions to be listed. Included region will be doing better in this case.

    1. Sep 02, 2010

      Patrick Renaud says:

      I second that. Did you submit a JIRA for this yet?

      I second that. Did you submit a JIRA for this yet?

  19. Sep 14, 2010

    John Firebaugh says:

    I would like to use the "pre-build branch merging" features mentioned, but I wan...

    I would like to use the "pre-build branch merging" features mentioned, but I want hudson to either:

    • accept only fast-forward merges, or
    • rebase instead of merge (ignoring branches that don't rebase cleanly)

    I work in an environment where `git pull --rebase` is preferred, so I don't want hudson cluttering up the commit history with its own merge commits.

    Is there any way to accomplish this?

  20. Oct 19, 2010

    David Antliff says:

    I have upgraded the git plugin from 0.8 to 1.1 (under Hudson 1.380) and I'm seei...

    I have upgraded the git plugin from 0.8 to 1.1 (under Hudson 1.380) and I'm seeing a new problem with submodules and tags. It appears that in some circumstances (exact ones not yet known, I'm still investigating) the tags within a submodule are fetched into the main (i.e. parent) clone. This has build-terminating results in my case, but is probably just weird for most people.

    In this, there's a submodule called 'build-scripts' that is bound to the path 'build' within the parent clone (DAC16_v2):

    Cloning the remote Git repository
    Cloning repository origin
    $ c:\cygwin\bin\git.exe clone -o origin git://gitsj/git/sp/modules/DAC_16v2.git C:\hudson\jobs\DAC_16v2-release-1.0\workspace
    Fetching upstream changes from git://gitsj/git/sp/modules/DAC_16v2.git
    [workspace] $ c:\cygwin\bin\git.exe fetch -t git://gitsj/git/sp/modules/DAC_16v2.git +refs/heads/*:refs/remotes/origin/*
    [workspace] $ c:\cygwin\bin\git.exe rev-parse origin/release-1.0
    Commencing build of Revision 2301bed44fa71fb71b60507ae534bcff4bbee324 (origin/release-1.0)
    GitAPI created
    Checking out Revision 2301bed44fa71fb71b60507ae534bcff4bbee324 (origin/release-1.0)
    [workspace] $ c:\cygwin\bin\git.exe checkout -f 2301bed44fa71fb71b60507ae534bcff4bbee324
    [workspace] $ c:\cygwin\bin\git.exe submodule init
    [workspace] $ c:\cygwin\bin\git.exe submodule sync
    Fetching upstream changes from git://gitsj/git/sp/modules/DAC_16v2.git
    [workspace] $ c:\cygwin\bin\git.exe fetch -t git://gitsj/git/sp/modules/DAC_16v2.git +refs/heads/*:refs/remotes/origin/*
    [workspace] $ c:\cygwin\bin\git.exe ls-tree HEAD
    Trying to fetch build into C:\hudson\jobs\DAC_16v2-release-1.0\workspace\build
    GitAPI created
    Fetching upstream changes from git://gitsj/git/sp/tools/build-scripts.git
    [build] $ c:\cygwin\bin\git.exe fetch -t git://gitsj/git/sp/tools/build-scripts.git +refs/heads/*:refs/remotes/origin/*
    warning: no common commits
    From git://gitsj/git/sp/tools/build-scripts  + f94c6f4...ee4c0c9 master     -> origin/master  (forced update)
     * [new branch]      ngo-dependencies -> origin/ngo-dependencies
     * [new tag]         released-1.0 -> released-1.0
     * [new tag]         released-1.1 -> released-1.1
     * [new tag]         released-1.2 -> released-1.2
     * [new tag]         released-1.3 -> released-1.3
     ...
    [workspace] $ c:\cygwin\bin\git.exe submodule update
     ...
    

    You can see around the "warning: no common commits" that the plugin is fetching from the submodule (build-scripts.git)!

    Trying to fetch build into C:\hudson\jobs\DAC_16v2-release-1.0\workspace\build
    ...
    Fetching upstream changes from git://gitsj/git/sp/tools/build-scripts.git

    That's not right. Those new branches and tags are in the submodule but are being fetched into the parent. It shouldn't be doing this.

    EDIT: new info - existing Hudson jobs from pre-upgrade work fine and the submodule tags are not 'merged' with the parent. But if I 'clear workspace' and rebuild any of them, they exhibit the incorrect behaviour noted above.

    1. Oct 19, 2010

      David Antliff says:

      How do I get 'permission' to create a new JIRA issue? I signed up for a dev.java...

      How do I get 'permission' to create a new JIRA issue? I signed up for a dev.java.net account but when I click on the "create issue" link at the top of this page, JIRA tells me:

      Errors

      • pid: You do not have permission to create issues in this project.
    2. Nov 01, 2010

      David Antliff says:

      Ok, this is a pretty major bug and is also a regression as older versions do not...

      Ok, this is a pretty major bug and is also a regression as older versions do not have this problem. I want to file a proper bug report but (as above) I get a permission error. So what can I do to help this bug get fixed?

    3. Nov 11, 2010

      David Antliff says:

      Once again, this is a major bug and needs to be addressed. Since nobody has told...

      Once again, this is a major bug and needs to be addressed. Since nobody has told me how I can file a proper bug report, what am I supposed to do?

      BTW I found a workaround - using a Cygwin shell in the workspace directory, I did:

        $ git tag | xargs git tag -d

        $ git fetch --tags

      This restored all of the tags that are meant to be there, and did not reintroduce those that were wrong. Subsequent builds now behave properly, but it is still a problem for new build jobs, especially as our Hudson server filesystem is not accessible to users.

    4. May 17, 2011

      David Antliff says:

      Again I ask politely yet earnestly for this bug to be addressed please. My curr...

      Again I ask politely yet earnestly for this bug to be addressed please.

      My current workaround involves every build deleting all local tags and then re-fetching them from the server. This is becoming slower and slower as more tags appear in the repository. If I don't do this, the parent repository is completely overwhelmed with tags that have 'leaked' from the submodules into the parent repository. More recently I have been creating a new style of Jenkins jobs that are almost completely broken by this bug because they rely on specific tags to be present (or not present) at the start of the process.

      Clearly this plugin should not be adding tags defined in submodules to the reference database of the parent repository!

      Again, if there's anything I can do to help debug this, please let me know. I am happy to help if we can get this bug fixed.

      1. May 17, 2011

        David Antliff says:

        I'll also clarify that this bug is a regression - it was not present in version ...

        I'll also clarify that this bug is a regression - it was not present in version 0.8, introduced some time before (or at) 1.1. It is still present in 1.1.6.

  21. Nov 02, 2010

    Doug Reiland says:

    I want to setup trigger on commits to branches, merge branch to integration bran...

    I want to setup trigger on commits to branches, merge branch to integration branch, build, and push changes back to integration branch on remote.
    I have it mostly working, but when the git plugin pushes the merge back, it triggers another build.

    I tried change the refspec option to something like:
    +refs/for/:refs/remotes/foo-repo/

    and developer pushes changes to refs/for/<somename>, but didn't help.
    Under the "git publisher" options, branch to push is refs/heads/golden

  22. Nov 02, 2010

    Doug Reiland says:

    Maybe somebody can give me step by step instructions. I want hudson to trigger o...

    Maybe somebody can give me step by step instructions.
    I want hudson to trigger on changes, I have this working with post-receive hook in "global repository"
    I want the development to push changes to temporary branches in "global repository", say like:
    git push "global repository" HEAD:refs/heads/username/fixes

    I want hudson to trigger, merge the changes into the "golden" branch from "global repository", build, and on success push changes back to golden branch on "global repository"

    In addition, I want to delete the temporary branch in "global repository" as a post build step.
    Ideally, I don't want hudson's push to golden to trigger another build.

    Thanks!

  23. Nov 02, 2010

    Doug Reiland says:

    Also, what is the best way to get the name of the branch that cause the trigger ...

    Also, what is the best way to get the name of the branch that cause the trigger event? Are there environment variables set by the plugin?
    In the post-build script plugin, I want to do something like: git push <url> :$GIT_BRANCH to delete the branch

  24. Nov 22, 2010

    Patrick Renaud says:

    The latest release seems to be 1.1.3 but there is no corresponding entry for it ...

    The latest release seems to be 1.1.3 but there is no corresponding entry for it in the Changelog section. How can we find out what's new in 1.1.3?

  25. Mar 09, 2011

    David Antliff says:

    What's a token macro? At the time of writing, the link in the Changelog for 1.1....

    What's a token macro? At the time of writing, the link in the Changelog for 1.1.6 goes to an empty wiki page.

  26. Mar 24, 2011

    anthony dass says:

    It looks the GIT plugin from Hudson is not able to find the ssh keys. When i tri...

    It looks the GIT plugin from Hudson is not able to find the ssh keys. When i tried from GIT Bash i could see the commands are working fine but the same when executed via GIT Plugin in Hudson, i see the above discussed errors. Also, I tried looking at the environment variables from HUDSON, and i see the variable HOME pointing this directory. I see many suggestions on Linux but not anything on Windows. Could any one suggest me how to get it configured? My environment is on windows 7 and the hudson sits on Tomcat and the  .ssh directory is in H. Thanks!

  27. Apr 21, 2011

    Lee Walton says:

    I've added a wrapper around the git executable so that I can set up ssh-agent et...

    I've added a wrapper around the git executable so that I can set up ssh-agent et al. However, I'm getting the following error when a build is executed:

    Started by user xxxxxxxx
    Checkout:workspace / /var/lib/jenkins/jobs/Server/workspace - hudson.remoting.LocalChannel@1862621
    Using strategy: Default
    Checkout:workspace / /var/lib/jenkins/jobs/Server/workspace - hudson.remoting.LocalChannel@1862621
    Wiping out workspace first.
    Cloning the remote Git repository
    Cloning repository origin
    Fetching upstream changes from git@kamayaq.unfuddle.com:kamayaq/kamayaq-server.git
    Commencing build of Revision 0e18c6b7954277a7a6a1d7fba972967a2051328d (origin/KAMAYAQ_V1_1)
    Checking out Revision 0e18c6b7954277a7a6a1d7fba972967a2051328d (origin/KAMAYAQ_V1_1)
    FATAL: Could not apply tag jenkins-Server-13
    hudson.plugins.git.GitException: Could not apply tag jenkins-Server-13
    	at hudson.plugins.git.GitAPI.tag(GitAPI.java:645)
    	at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1070)
    	at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1020)
    	at hudson.FilePath.act(FilePath.java:757)
    	at hudson.FilePath.act(FilePath.java:739)
    	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1020)
    	at hudson.model.AbstractProject.checkout(AbstractProject.java:1174)
    	at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:523)
    	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:418)
    	at hudson.model.Run.run(Run.java:1362)
    	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:467)
    	at hudson.model.ResourceController.execute(ResourceController.java:88)
    	at hudson.model.Executor.run(Executor.java:145)
    Caused by: hudson.plugins.git.GitException: Error performing command: /var/lib/jenkins/git-wrapper.sh tag -a -f -m Jenkins Build #13 jenkins-Server-13
    Command "/var/lib/jenkins/git-wrapper.sh tag -a -f -m Jenkins Build #13 jenkins-Server-13" returned status code 128: fatal: too many params
    
    	at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:691)
    	at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:656)
    	at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:666)
    	at hudson.plugins.git.GitAPI.tag(GitAPI.java:643)
    	... 12 more
    Caused by: hudson.plugins.git.GitException: Command "/var/lib/jenkins/git-wrapper.sh tag -a -f -m Jenkins Build #13 jenkins-Server-13" returned status code 128: fatal: too many params
    
    	at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:686)
    	... 15 more
    

    The command executes fine outside of Jenkins.

    The scripts used are as follows:

    git-wrapper.sh:

    #!/bin/bash
    source ~/add-ssh-key.sh 1>/dev/null 2>/dev/null
    /usr/bin/git $*
    

    add-ssh-key.sh:

    #!/bin/bash
    
    SSH_ENV="$HOME/.ssh/environment"
    
    if [ -x /usr/bin/ssh-agent ]
    then
        SSH_AGENT=/usr/bin/ssh-agent
        SSH_ADD=/usr/bin/ssh-add
    else
        echo "Can't find ssh-agent"
        SSH_AGENT=/bin/false
        SSH_ADD=/bin/false
    fi
    
    start_agent () {
    
        printf "Starting new SSH agent... "
        $SSH_AGENT > "${SSH_ENV}"
        if [ $? = 0 ]
        then
            echo "OK"
            printf "3s|^echo|#echo|\nw\n\q\n" | ed "${SSH_ENV}" >/dev/null 2>&1
            chmod 600 "${SSH_ENV}"
            . "${SSH_ENV}"
        else
            echo "ERROR"
        fi
        $SSH_ADD -l | grep : || {
            $SSH_ADD;
        }
    
    }
    #
    # Source SSH settings, if there
    #
    if [ -f "${SSH_ENV}" ]; then
        . "${SSH_ENV}"
        #ps ${SSH_AGENT_PID} doesn't work under cywgin
        ps -fu$LOGNAME | grep ${SSH_AGENT_PID}.*ssh-agent$ >/dev/null
        if [ $? != 0 ]
        then
            start_agent;
        else
            $SSH_ADD -l | grep : || {
                echo "Agent is running, but has no keys..."
                $SSH_ADD
            }
        fi
    else
         start_agent;
    fi
    
    ssh-add ~/.ssh/mygitkey >/dev/null
    

    Any ideas?

    1. Apr 21, 2011

      David Antliff says:

      At a glance, it may be related to your git-wrapper script calling 'git $*' - tha...

      At a glance, it may be related to your git-wrapper script calling 'git $*' - that will split the tag "Jenkins Build #13 ..." into separate parameters - "Jenkins", "Build", "#13", etc.

  28. Jul 13, 2011

    Tim Gover says:

    Hi, Is there anyway to limit the size of the history in the changelog ? I have ...

    Hi,

    Is there anyway to limit the size of the history in the changelog ? I have just imported a large module into a git subtree with 1000s of changes (changelog.xml is 203MB) , this is causing Jenkins to run out of memory. If I manually delete the changelog.xml files and restart Jenkins this is fine but I think the problem can occur again if I create new slave nodes or import other repositories.

    Tim

  29. Jul 27, 2011

    Mike Jongejan says:

    Hi, Is there a way to tag certain builds from the Jenkins dashboard? I don't wa...

    Hi,

    Is there a way to tag certain builds from the Jenkins dashboard? I don't want every build to be automatically tagged, but for some builds it would be nice to push a button in Jenkins and lat it tag the buildnr to git.

    Mike

  30. Sep 20, 2011

    Jason Zhang says:

    Hi, I have a project building from GIT tags. I couldn't see the list of changes...

    Hi,

    I have a project building from GIT tags. I couldn't see the list of changes between two tags. But I could see changes in other projects which build from GIT branches. Is the GIT tag the reason for this issue?

    Thanks

  31. Sep 26, 2011

    Tim Dennison says:

    I'm trying to set up a build using a remote branch named "feature/Configurations...

    I'm trying to set up a build using a remote branch named "feature/Configurations".   I can't seem to find the right configuration for the git configuration for the build.  Currently, I have:

    URL of repository: git://server.domain/mve/mve.git

    Branch Specifier: feature/Configurations

    This configuration yields:

    Pruning obsolete local branches
    ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
    Recording test results
    Finished: FAILURE
    

    Does the GIT plugin support building remote branches?

    1. Sep 26, 2011

      David Antliff says:

      Try *origin/*feature/Configurations. Otherwise perhaps there's a problem with th...

      Try *origin/*feature/Configurations. Otherwise perhaps there's a problem with the plugin when the branch contains a / character.

  32. Oct 21, 2011

    Curtis Wilson says:

    Perhaps I'm missing something, but why would the git plugin be attempting to del...

    Perhaps I'm missing something, but why would the git plugin be attempting to delete a local tag that doesn't exist? I have git configured to build and perform a maven release on any change to master.
    The repository definition has the "Skip Internal Tag" selected, which should not create a job tag, correct? However, after creating a maven release which successfully deploys, the job is failing on delete of the jenkins job tag.
    Is this working as designed? Is there a workaround to skip the deletion of that tag??

    Selected info from jenkins log:
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESSFUL
    [INFO] ------------------------------------------------------------------------
    .....
    channel stopped
    ERROR: Failed to push merge to origin repository: Could not delete tag jenkins-spwebsite-release-18

  33. Oct 27, 2011

    Tony Peguero says:

    Is the GIT_BRANCH macro supposed to include the repository/remote name? In other...

    Is the GIT_BRANCH macro supposed to include the repository/remote name? In other words, should it look like "origin/master" or just "master"? The comment on issue #9510 seems to suggest that it should not include that part.

    The reason I ask is that I am trying to chain some jobs together, so that an SCM change triggers a build, then the build job triggers a parameterized test job to run tests on the branch that changed. The build job is passing $GIT_BRANCH into the test job's "branch" parameter, and this parameter's value is used in the "Branches to build" field of the test job. But because the GIT_BRANCH includes the "origin" part, the test job is failing with the message "ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job."

    Jenkins doesn't provide any easy way to manipulate the strings used in fields like that, so it seem like the GIT_BRANCH should either not include the remote name, or the plugin should be smart enough to strip it out if passed into the "Branches to build" field.

    1. Jan 11, 2012

      Jesse Cary says:

      Just add an "Execute shell" script in the Build that sets a new variable that re...

      Just add an "Execute shell" script in the Build that sets a new variable that removes origin/

       BRANCH=${GIT_BRANCH#origin/} 
  34. Oct 31, 2011

    Dane Powell says:

    Is there a way to use a token / variable as the branch specifier? In other words...

    Is there a way to use a token / variable as the branch specifier? In other words, if the title of my job is "dev_branch", can I set the branch specifier to be "${JOB_TITLE}" or something in order to checkout dev_branch? I'm interested in doing this so that I can easily clone existing jobs to build different branches in the same repository, and all I would need to change is the job title...

    1. Dec 06, 2011

      Dane Powell says:

      I ended up making my job parameterized with "BRANCH" as a string parameter, then...

      I ended up making my job parameterized with "BRANCH" as a string parameter, then I put $BRANCH for the branched specifier.

  35. Dec 09, 2011

    Mark MacVicar says:

    I occasionally encounter an error in git clean on WIndows that I can't figure ou...

    I occasionally encounter an error in git clean on WIndows that I can't figure out. Jobs run fine for weeks then rarely have a problem removing a file:

    hudson.plugins.git.GitException: Error performing command: C:\Program Files (x86)\Git\cmd\git.cmd clean -fdx
    Command "C:\Program Files (x86)\Git\cmd\git.cmd clean -fdx" returned status code 1: Removing

    Then the problem goes away. I haven't been able to diagnose it fully because I haven't caught it fast enough. By the time I come across it, several more builds have gone through the workspace successfully.

    Has anyone else had issues with "git clean" failing intermittently using this plugin?

  36. Dec 14, 2011

    Tony Peguero says:

    I'm having an issue with some builds coming through with "origin/HEAD" in the GI...

    I'm having an issue with some builds coming through with "origin/HEAD" in the GIT_BRANCH variable, when what has actually changed is the master branch. My intention is to build any branch that has changed, and use the GIT_BRANCH variable to determine which branch it is, so I know where to copy the build output and so forth. However, I do not want to ever see HEAD builds. Anything that's not an actual branch name is meaningless to me and my team. How can I prevent this? I've tried the new inverse strategy with "*/HEAD", but that did not work.

  37. Jan 12, 2012

    Alexey Java says:

    is it possible to fix bug  https://issues.jenkins-ci.org/browse/JENKINS-12...

    is it possible to fix bug 

    https://issues.jenkins-ci.org/browse/JENKINS-12316 ( git plugin should NOT tag every build by default )

    in version 1.1.16? this is a blocker for us. we had to disable the build in Jenkins

  38. Jan 13, 2012

    Peter Gengler says:

    Hi, I use various labels for branches in git (i.e. release/, hotfix/, feature/,...

    Hi,

    I use various labels for branches in git (i.e. release/, hotfix/, feature/, etc.) and I'd like to have a worker that builds a specific pattern of branch.  For example on release/* I want to do different things for the build, and I don't want to build any feature/, etc.  Is there some way to do this?  I've tried (I think) release, release/* and release/** and none of those work.

    Related side note, it'd be nice as part of this plugin to have it do a dry-run of the branch picking strategy so that you could set the Branch Specifier and then check what it returns; currently I have to change, request a build, see it fail, change again ...

    Thanks,

    \Peter

  39. Feb 10, 2012

    Pascal Robert says:

    Is there a way to use parameters with the local subdirectory for repo and the un...

    Is there a way to use parameters with the local subdirectory for repo and the unique SCM name? If I set "Local subdirectory for repo" like this:

    Projects/${PROJECT_NAME}
    

    I get:

    Cannot run program "git" (in directory "/var/lib/jenkins/jobs/ERGroupware2/workspace/Projects/${PROJECT_NAME}"): java.io.IOException: error=2, No such file or directory
    

    Would be useful to be able to use parameters value for the local name of the repo.

  40. Mar 16, 2012

    Kreislsepp . says:

    I just want git to to check some branches for changes and work as trigger for a ...

    I just want git to to check some branches for changes and work as trigger for a job. That means no cloning, tagging, whatsoever. Since I want to get some stuff from the git log (timestamp, revision, tag etc) and the plug in messes that up, up until now I have to remove the files first and then clone the repository again "myself". How can I archive that? I stumbled over "disabling of internal tagging (issue #5676), but that is not "enough".

  41. Apr 04, 2012

    Bryan Rahn says:

    I just upgraded to the latest GIT plugin, and am receiving this error when build...

    I just upgraded to the latest GIT plugin, and am receiving this error when building my Xcode project, which has multiple submodules it needs to checkout and update: Commencing build of Revision b9279cd90472534862c412a72962b445a43228f8 (origin/master)
    Checking out Revision b9279cd90472534862c412a72962b445a43228f8 (origin/master)
    FATAL: Error performing command: git submodule update --init --recursive
    Command "git submodule update --init --recursive" returned status code 1:
    ...
    ...
    ...
    Please move or remove them before you can switch branches.
    Aborting

  42. Apr 12, 2012

    Thomas Sondergaard says:

    I've found that using plink.exe from putty is 8-10 times faster than the ssh.exe...

    I've found that using plink.exe from putty is 8-10 times faster than the ssh.exe that is shipped with msysGit. You can find a posting about the slowness of the shipped ssh.exe here: http://groups.google.com/group/msysgit/browse_thread/thread/c47054f2d14d0981

    If you install putty before msysgit, the msysgit installer will give you an option to use plink.exe from putty instead of the shipped ssh.exe.

  43. Aug 28, 2012

    Johnny Kauffman says:

    I've got to say. The logging or diagnostic capabilities surrounding initial setu...

    I've got to say. The logging or diagnostic capabilities surrounding initial setup (such as the "git clone" that occurs on a job's first run) definitely need some work.

    A windows user like myself has more hangups than others to get it up and running, all of which would be easier to identify with better logging. Here are some major common problems that prevent someone from picking up and using this plugin:

    • This plugin does not gracefully handle spaces in path names. It's probably not the only one.
    • Defaulting to "git.exe" rather than "git" produces the ambiguity on windows systems that actually use "git.cmd".
    • I was not allowed to use my actual ".ssh" directory which is on H: instead of C: . So now I have two copies!
    • The "trusted host" nonsense is a bear especially considering there are now two copies of all my .ssh settings floating about, one of which specifically catered to jenkins.

    All of this is incredibly difficult to diagnose because "git clone" hangs and fails silently, and this should be rearchitected. There are many blog posts floating about the internet each seemingly individually solving these problems after a long day's work. The problems above could all be alleviated considerably if users are given more information to point them in the right direction.

  44. Oct 09, 2012

    Chuck Reeves says:

    Rather then dealing with all that local user messiness on windows, Just set the ...

    Rather then dealing with all that local user messiness on windows, Just set the server to run as your user:

    1. Right click "My Computer" -> Manage
    2. Goto services (Win7 under Services and Applications)
    3. Find the Jenkins service and right click on Properties
    4. Click on the log on tab
    5. Select This account
    6. Login with your Windows Login

    This way it will use your home directory with your ssh keys.

  45. Oct 18, 2012

    Ruth Morgenstein says:

    I just upgraded from 1.1.21 to 1.1.25 and ALL of my jobs that poll github d...

    I just upgraded from 1.1.21 to 1.1.25 and ALL of my jobs that poll github decided that there were changes.  The git build messages are identical in the build before the upgrade and the build after.

    Here is my console output - I notice that it has no idea what the 'last built revision' was:09:41:22 Started by an SCM change
    09:41:22 Building remotely on i-e934d195 in workspace /mnt/jenkins/workspace/branch-2-community-junit-U10.04-master
    09:41:22 Checkout:branch-2-community-junit-U10.04-master / /mnt/jenkins/workspace/branch-2-community-junit-U10.04-master - hudson.remoting.Channel@2a860bf4:i-e934d195
    09:41:22 Using strategy: Default
    09:41:22 Fetching changes from 1 remote Git repository
    09:41:22 Fetching upstream changes from git@github.com:VoltDB/voltdb.git
    09:41:23 Commencing build of Revision caf5be16caf652540da96c5237ea397a55276ab4 (origin/master)
    09:41:23 Checking out Revision caf5be16caf652540da96c5237ea397a55276ab4 (origin/master)
    09:41:23 Cleaning workspace
    09:41:23 Resetting working tree
    09:41:24 No change to record in branch origin/master

    Is there anything I can update in my builds so that I can delete all the grey/aborted builds that show up for all my topic branches?  Right now, nobody can easily see status - each topic branch has 5 jobs, 2 of which are grey - making the sub-view grey.  If I delete the aborted builds, the whole cycle starts again.

  46. Nov 14, 2012

    michael d says:

    With the svn plugin, when checking out code from the repository the console log ...

    With the svn plugin, when checking out code from the repository the console log would show which files are being checked out.

    With git plugin I only get a summary but can't see the files as they are pulled. Is there a way to enable this functionality in the git plugin as well ? (maybe 'verbose' flag or something ?)

    Thanks. 

  47. Nov 19, 2012

    Scott Armit says:

    I was very keen on the option of "Merge Before Build." That makes a lot of sense...

    I was very keen on the option of "Merge Before Build." That makes a lot of sense to allow feature branches to validate against a downstream branch like "master" (assuming a Gitflow-like workflow where master is what's on production). However, using Maven the version in POM files on master would be, by definition, always behind the feature branch version. Therefore, the "merge before build" would always fail. Am I missing something? For example:

    master branch version is 1.0.0

    feature branch version is 1.1.0-SNAPSHOT

    Git merge would fail every time via this plugin because it would not know how to deal with those version numbers. Has anyone else hit this?

    Any help is appreciated.

    Thank you.

  48. Feb 22, 2013

    Yimin Li says:

    Thanks for the plugin.

    Thanks for the plugin.

  49. Feb 25, 2013

    Michael Powell says:

    I need a little help. I have installed Git and I have installed Jenkins, and as ...

    I need a little help. I have installed Git and I have installed Jenkins, and as far as I know, I have installed a version of the Git Client? But I am having difficulty getting it to go correctly.

    I am installing on Linux Ubuntu 10.04 LTS. As far as I know have the Jenkins user home directory set correctly, SSH more or less configured. How do I tell a Jenkins Job that it's got Git? My only choices are CVS, None, and Subversion.

    Thank you...

    Regards,

    Michael

  50. Apr 10, 2013

    Philipp Schneider says:

    Hello, we have an issue with the name of the branch. We have the git-flow patte...

    Hello,

    we have an issue with the name of the branch. We have the git-flow pattern name and there we have a branch named

    feature/PROJECT-4011-SomeCoolFeature

    Seems like there is an issue with a branch name containing a "/".

    Anybody else having the same issue? 

  51. Apr 30, 2013

    Kailash Yadav says:

    Hello, Is there way to get list of file changes from last build? My requi...

    Hello,

    Is there way to get list of file changes from last build?

    My requirement :

    I have 3 ant scripts and only one script should be execute, which is depend on changed file/folder.

    for eg:

    if path/to/my/project/package1/* changed -> execute build1.xml.

    if path/to/my/project/package2/* *changed -> execute *build2.xml.

    if path/to/my/project/package3/* *changed -> execute *build3.xml.

    Thanks

  52. May 16, 2013

    Zaraki Kenpachi says:

    Hello, why it isn't possible to use the variables of matrix build in the git pl...

    Hello,

    why it isn't possible to use the variables of matrix build in the git plugin?

  53. Feb 08

    Max Spring says:

    Is it possible to exclude certain directories/files from being removed when usin...

    Is it possible to exclude certain directories/files from being removed when using the "Clean after checkout" option?
    I use a private local Maven repository sitting in the workspace of a Gerrit verification job.
    I would like to keep this local Maven repository for performance reasons, while using "Clean after checkout".
    Sort of: "exclude=$WORKSPACE/.repository"

    In addition to an exclude option for "Clean after checkout", I would like to have an include option, where I would then specify certain hierarchies within the private local repository to be cleaned, like "include=$WORKSPACE/.repository/org/myorg/".

  54. Feb 14

    Jeremy Rampon says:

    Hello, Is it possible to pass extra parameters to a job when using the notifyCo...

    Hello,

    Is it possible to pass extra parameters to a job when using the notifyCommit url?

    curl http://server/jenkins/git/notifyCommit?url=<repo-url>[&branches=branch1[,branch2]*][&sha1=<commit-id>][&extra_opt=<opt>]
    

    If not, would it make sense to create a ticket to add this?
    The git plugin could potentially consume all its known parameters (url, branches, sha1), and if there are any parameters left, pass them to the jobs configured with that git url. These jobs would be called with /buildWithParameters, and all the extra parameters would be passed to them.

  55. Feb 23

    Vlad Aginsky says:

    Hi all, I want to detect and build tags from only one specific branch, and I do...

    Hi all,

    I want to detect and build tags from only one specific branch, and I don't know exactly what the tag string will look like.

    Do you know how to configure git plugin for this?

    I read this:

    http://erics-notes.blogspot.co.il/2013/05/jenkins-build-latest-git-tag.html

    It gives a solution for "automatically build the latest tag in a git repository", not limited to specific branch. It can be easily adopted to look for tags meeting some regular expression, unfortunately I don't have a reliable way to predict what future tags will look like.