从KIE Workbench仓库克隆后推送到git仓库

6

我在使用 KIE Workbench (6.1.0.Beta3) 编辑我的规则。由于某些功能尚未得到支持(例如将规则移动到其他包中),因此我希望在 KIE-WB 之外完成这些操作。

为此,我使用以下命令克隆了我的存储库:

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

一切运行良好。我编辑了一些文件,本地提交后尝试进行git push。但是我收到了错误提示。

fatal: Could not read from remote repository.

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

由于我几乎可以确定这是第一个问题,与凭据有关,所以我在.git/config文件中添加了以下行:

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

然而,我仍然遇到之前提到的错误。是的,KIE Workbench仍在运行中,我也可以轻松地从那里获取/拉取,没有任何问题。

有没有办法将更改推回到KIE Workbench存储库?根据此消息,可能需要“重新配置原点”,但我不确定如何更改它。

有人知道如何正确设置这个吗?


1
Git协议不提供身份验证,且只能读取。http://git-scm.com/book/en/Git-on-the-Server-The-Protocols - kaman
谢谢,@kaman,但是我应该如何将它们推送到那个仓库呢?我无法使用ssh克隆(我的管理员登录凭据不起作用),因此我无法将它们推送到那里。推送到KIE Workbench存储库的正确凭据是什么? - Dominik Sandjaja
5个回答

2

我使用 Kie 6.5 时也遇到了类似的问题,无法推送到 kie-wb 的 git 存储库。

以下是我找到的解决方法:

首先,使用 ssh 协议而不是 git 克隆 wb 存储库。

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

kuser: 您的wb用户

repository: 您的wb代码仓库名称

附注:我是在使用Eclipse时完成的,需要告诉它密码。

当您尝试与刚克隆的仓库交互时,可能会遇到授权错误。

$ 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. 

看起来 Kie-wb 6.5git 的 ssh 服务器依赖于 dsa (dss) 认证。

因此,您可能需要告诉您的 git 客户端使用 wb 的 git 的 ssh 服务器语言(认证算法):

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

在那之后,如果您再次尝试拉取,您将被提示输入您的 wb 用户密码,输入后即可:

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

使用Eclipse Git客户端,您可以保存您的凭据,无需每次都输入。

设置DSA密钥并进行身份验证更好,但不幸的是,直到现在我仍然没有成功使其工作,尽管我已经将我的DSA密钥添加到SSH服务器中。


1
我发现ssh协议请求可以处理该请求;
 $ git clone ssh://adminsf1@10.101.81.72:8001/uf-playground
cloning 'uf-playground'...
Authenticated with partial success.
Password authentication
Password: 
remote: Counting objects: 967, done
remote: Finding sources: 100% (967/967)
remote: Getting sizes: 100% (459/459)
remote: Total 967 (delta 385), reused 967 (delta 385)
receiveing objects: 100% (967/967), 154.58 KiB | 0 bytes/s, done.
dela with delta : 100% (385/385), done.
complete。

$ echo "heello" >> hello2
$ git add hello2 
$ git commit -i -m "add hello2 now" hello2 
[master a78762f] add hello2 now
 1 file changed, 1 insertion(+)
 create mode 100644 hello2
$ git push
Authenticated with partial success.
Password authentication
Password: 
Counting objects: 5, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 271 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1)
remote: Updating references: 100% (1/1)
To ssh://adminsf1@10.101.81.72:8001/uf-playground
   273c880..a78762f  master -> master

请注意用户:adminsf1

此用户是通过jboss/bin下的add_user.sh添加的。

一些提示: 1. 未生成ssh-key并将其存储到Guvnor .security目录中无效:<,我不明白".security"目录的功能是什么,"org.uberfire.nio.git.ssh.cert.dir: Location of the directory .security where local certtificates will be stored. Default: working directory"

除了一个名为hostkey.ser的文件外,添加用户后没有更多信息:<

  1. 我尝试使用git协议将代码推送到guvnor git服务器,但失败了,但我可以从git克隆

这就是我不理解的地方

祝好运


1
谢谢,但是您给用户adminsf1分配了哪些角色?我现在尝试使用我的常规KIE WB用户,但是身份验证失败,尽管凭据是正确的。您用哪个操作系统运行KIE WB?我们有一个Windows系统,可能是罪魁祸首吗? - Dominik Sandjaja

0
@gammachen的ssh示例对你应该有效。我正在tomcat 7上运行kie-wb。
我有以下用户:
<user username="tomcat" password="tomcat" roles="tomcat,role1,manager-gui,admin"/>

然后你可以这样做:

git clone ssh://tomcat@localhost:8001/uf-playgroundere

在我的情况下,密码将是tomcat
我的.git/config看起来像:
]$ cat uf-playground/.git/config 
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = ssh://tomcat@localhost:8001/uf-playground
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master

希望这有所帮助。

0
在配置文件的 .ssh 下添加以下内容即可解决问题:
Host localhost HostkeyAlgorithms +ssh-dss

0
  1. 在您的桌面上新建一个文件夹
  2. 输入并打开git bash
  3. 执行以下命令:

    git init
    git config core.sshCommand "ssh -oHostKeyAlgorithms=+ssh-dss"
    git pull ssh://admin@0.0.0.0:8001/uf-playground
    

    输入管理员密码(默认为admin)


这基本上就是三年前@gammachen的回答,使用SSH代替git协议。但我不再从事那项技术了,所以无法检查,抱歉;-) - Dominik Sandjaja

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接