简体   繁体   English

推送从KIE Workbench存储库克隆的git存储库

[英]Pushing to git repository cloned from KIE Workbench repository

I use KIE Workbench (6.1.0.Beta3) to edit my rules. 我使用KIE Workbench(6.1.0.Beta3)来编辑我的规则。 Since there are some features not being supported by the Workbench yet (eg moving rules to other packages), I would like to do this stuff outside of KIE-WB. 由于Workbench还没有支持某些功能(例如将规则移到其他包中),我想在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. 我编辑一些文件,在本地提交它们,然后尝试git push 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 因为我几乎可以肯定它是第一个问题,关于凭证,我在.git/config文件中添加了行

[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. 是的,KIE Workbench仍在运行,我也可以从那里获取/拉取没有问题。

Is there any way how to push back to that KIE Workbench repository? 有没有办法如何回到KIE Workbench存储库? 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? 有人知道如何正确设置吗?

With Kie 6.5 I had a similar problem, couldn't push to kie-wb's git repository. 使用Kie 6.5我遇到了类似的问题,无法推送到kie-wb的git存储库。

Following is how I found a way to push. 以下是我找到推动方式的方法。

First clone your wb repo with the ssh protocol rather than git . 首先使用ssh协议而不是git克隆你的wb repo。

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

kuser : your wb user kuser :你的wb用户

repository : your wb repo name repository :你的wb repo名称

PS I did that with eclipse and needed to tell it the pwd too. PS我用eclipse做到了这一点,并且需要告诉它pwd。

When you try to interact with the repo you've just cloned, you'd get an authorization error. 当您尝试与刚刚克隆的repo进行交互时,您将收到授权错误。

$ 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. 看起来像Kie-wb 6.5git的ssh服务器依赖于dsa(dss)身份验证。

So you might need to tell your git client to talk wb's git's ssh server language (auth algorithm): 所以你可能需要告诉你的git客户端谈论wb的git的ssh服务器语言(auth算法):

$ 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: 在那之后,如果你再次尝试拉动你会得到你的wb用户密码提示,输入它就可以了:

$ 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. 使用eclipse git客户端,您可以保存凭据,而不必每次都写入它。

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. 设置一个dsa密钥并对其进行身份验证甚至更好,但不幸的是,直到现在我还没有成功使用它,尽管我可以将我的dsa密钥添加到ssh服务器。

I find the ssh protocol request can deal with the request; 我发现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

take attention about the user: adminsf1 注意用户:adminsf1

this user is add by add_user.sh of jboss/bin 这个用户是由jboss / bin的add_user.sh添加的

Some tips: 1. there is no generating ssh-key and stroing to Guvnor .security directory work :<, i donnot understand what the function of the .security directory form the "org.uberfire.nio.git.ssh.cert.dir: Location of the directory .security where local certtificates will be stored. Default: working directory" 一些提示:1。没有生成ssh-key和stroing到Guvnor .security目录工作:<,我不明白.security目录的功能是什么形成了“org.uberfire.nio.git.ssh.cert.dir” :将存储本地证书的目录.security的位置。默认值:工作目录“

there are no more information exclude one file named hostkey.ser after add users :< 添加用户后,没有更多信息排除名为hostkey.ser的文件:<

  1. i fail with using git protocol to push code to guvnor git server as well, however i can clone from git 我使用git协议将代码推送到guvnor git服务器也失败了,但是我可以从git克隆

this is what i do not understand ye 这是我不明白的

good luck 祝好运

@gammachen's ssh example should work for you. @ gammachen的ssh示例应该适合你。 I am running kie-wb on tomcat 7. 我在tomcat 7上运行kie-wb。

I have the following user: 我有以下用户:

<user username="tomcat" password="tomcat" roles="tomcat,role1,manager-gui,admin"/>

You can then do something like: 然后你可以这样做:

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

In my case password will be tomcat . 在我的情况下,密码将是tomcat

My .git/config looks like: 我的.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

Hope that helps. 希望有所帮助。

  1. Open new folder on your desktop 在桌面上打开新文件夹
  2. Enter and open git bash here 在这里输入并打开git bash
  3. Call commands like 调用命令,如

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

    Enter admin user password (default: admin) 输入管理员用户密码(默认值:admin)

Solved the problem by adding the following to the config file under .ssh 通过在.ssh下的配置文件中添加以下内容解决了这个问题

Host localhost HostkeyAlgorithms +ssh-dss 主机localhost HostkeyAlgorithms + ssh-dss

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM