Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pushing to git repository cloned from KIE Workbench repository

I use KIE Workbench (6.1.0.Beta3) to edit my rules. Since there are some features not being supported by the Workbench yet (e.g. moving rules to other packages), I would like to do this stuff outside of KIE-WB.

For that, I cloned my repository with

git clone git://localhost:9418/my-kie-repository

which works fine. I edit some files, commit them locally and try a git push afterwards. But I get the error

fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

Since I am almost certain it is the first issue, something about credentials, I added to the .git/config file the lines

[credential "git://localhost:9418"]
    username = admin
    password = admin

Still, I get the previously mentioned error. And yes, the KIE Workbench is still running, I can also fetch/pull from there without problems.

Is there any way how to push back to that KIE Workbench repository? According to this message, one "might need to reconfigure origin", but I am unsure about how to change it.

Anyone an idea how to set this up correctly?

like image 1000
Dominik Sandjaja Avatar asked Oct 21 '22 08:10

Dominik Sandjaja


1 Answers

With Kie 6.5 I had a similar problem, couldn't push to kie-wb's git repository.

Following is how I found a way to push.

First clone your wb repo with the ssh protocol rather than git.

git clone ssh://kuser@localhost:8001/repository

kuser: your wb user

repository: your wb repo name

P.S. I did that with eclipse and needed to tell it the pwd too.

When you try to interact with the repo you've just cloned, you'd get an authorization error.

$ git pull                                                                                         
Unable to negotiate with 127.0.0.1 port 8001: no matching host key type found. Their offer: ssh-dss
fatal: Could not read from remote repository.                                                      

Please make sure you have the correct access rights                                                
and the repository exists. 

Looks like Kie-wb 6.5 's git's ssh server relies on dsa (dss) authentication.

So you might need to tell your git client to talk wb's git's ssh server language (auth algorithm):

$ git config core.sshCommand "ssh -oHostKeyAlgorithms=+ssh-dss"

After that if you try again to pull you'll get prompted for your wb user pwd, type it and you're ok:

$ git pull
Password authentication
Password:
Already up-to-date.

With eclipse git client you can save your credentials and won't have to write it every time.

It's even better to setup a dsa key and authenticate that way but unfortunately I didn't succeed to make it work till now although I could add my dsa key to the ssh server.

like image 93
aymens Avatar answered Oct 27 '22 21:10

aymens