I'm not able to push files using the Java API of bitbucket. The following code shows my attempt to add commits to a new and empty repository:
GitCommandBuilderFactory builderFactory; // imported with component-import
// create working directory (outside repository)
Path workTree = createWorkTree(repository);
// cloning repository to working directory
// create the file in the working directory
// add the file
.message(String.format("Added file %s", filename))
// push - here is where the error occurs
After executing the above code snippet, I get the following error:
[INFO] com.atlassian.bitbucket.scm.CommandFailedException: 'C:\Program Files\Git\cmd\git.exe push' exited with code 1 saying: remote: hooks/pre-receive: line 9: /c/Users/$username/Code/$projectname/target/bitbucket/home/shared/data/repositories/14/hooks/pre-receive.d: Is a directory
[INFO] remote: hooks/pre-receive: line 9: exec: /c/Users/$username/Code/$projectname/target/bitbucket/home/shared/data/repositories/14/hooks/pre-receive.d: cannot execute: Is a directory
[INFO] To C:\Users\$username\Code\$projectname\target\bitbucket\home\shared\data\repositories\14
[INFO] ! [remote rejected] master -> master (pre-receive hook declined)
[INFO] error: failed to push some refs to 'C:\Users\$username\Code\$projectname\target\bitbucket\home\shared\data\repositories\14'
I'm able to commit some files using the 'EditFileCommand,' but this does not fit my needs, as I need to modify some environment variables in the commit. Does anybody have an idea?
Hi everyone, We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events