java - Custom git push ant task wont work in JGit -
I am trying to use my custom git-push ant function JGIT, which is called the branch in the remote repository Should be pushed, but it does not seem to work.
Here's my Java code to work:
Public Zero Set Repository (string repository) {this.repository = repository; } Public Zero Set Password (String Password) {this.password = password; } Public Zero Set USUN (String Username) {this.username = Username; } Public Zero set Yuri (string uri) {this.uri = uri; } Public Zero Set Branch (string branch) {this.branch = branch; } Public executives execute () throws BuildException {try {git git = Git.open (new file (repository)); Credential Provider CP = New User Name Password Credential Provider (Username, Password); RefSpec spec = New RFSPC ("Refix / Head /" + Branch + ": Refix / Head /" + Branch); Push Command Push Commands = GT Pius (); PushCommand.setCredentialsProvider (CP) .setRemote (URI) .setForce (true) .setRefSpecs (idea) .call (); } Hold (exception e) {log (e, project.msg_ERR); Throw the new BuildException ("The repository can not be pushed:" + e.getMessage (), e); } And here's the line up of Apache HT Build file:
& lt; Gitpush repository = "./ myrepo" uri = "ssh: // Username @ Host.com / repo / project.git" branch = "mybranch" password = "77CJr2xr" /> I create a new branch and try to run this work. This work runs without exception, but there is no effect on the remote repository. I am very new to git, so this may be a silly mistake. Am I doing something wrong in RefSpec?
error message non-fast forward riff / head /////> On returning, after you have received or cloned the last time and someone else is pushed to the same branch. you> GIT Clone ... Bob & gt; GIT Clone ... Bob & gt; Git Cut Bob & gt; Git you & gt; GIT will give you & gt; Git push & lt; & Lt; - Error: Non-Fast Forward Rejected .Denine Nonfestford The configuration setting of the remote repository Whether non-fast-forward updates are generally allowed It is not allowed because it will change the history of the remote repository. In the above example, Bob's commitment will be lost. Search for more to reject the 'push push error' non-fast forward.
Comments
Post a Comment