标签: bitbucket

使用Python的HTTPBasicAuthHandler进行Bitbucket API身份验证

我正在尝试使用bitbucket的API获取私有存储库中的问题列表。

我已经确认HTTP基本身份验证可以与hurl一起使用,但是我无法在Python中进行身份验证。根据本教程的代码,我编写了以下脚本。

import cookielib
import urllib2

class API():
    api_url = 'http://api.bitbucket.org/1.0/'

    def __init__(self, username, password):
        self._opener = self._create_opener(username, password)

    def _create_opener(self, username, password):
        cj = cookielib.LWPCookieJar()
        cookie_handler = urllib2.HTTPCookieProcessor(cj)
        password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
        password_manager.add_password(None, self.api_url, username, password)
        auth_handler = urllib2.HTTPBasicAuthHandler(password_manager)
        opener = urllib2.build_opener(cookie_handler, auth_handler)
        return opener

    def get_issues(self, username, repository):
        query_url = self.api_url + 'repositories/%s/%s/issues/' % (username, repository)
        try:
            handler = self._opener.open(query_url)
        except urllib2.HTTPError, e:
            print e.headers
            raise e
        return handler.read()

api = API(username='my_username', password='XXXXXXXX') …
Run Code Online (Sandbox Code Playgroud)

python urllib2 bitbucket bitbucket-api

3
推荐指数
1
解决办法
2995
查看次数

DVCS(Github,BitBucket等)如何确保私有项目代码的完整性?

DVCS(Github,BitBucket等)如何确保私有项目代码的完整性?

当然,当您将代码上传到他们的在线存储库时,这些公司声称没有知识产权,但是如何确保项目的隐私,以便只有具有写入/提交访问权限的人才能真正查看数据?

如果您决定将项目移至私人服务器或其他主机,会发生什么?您的项目是否会被"删除"或仅从公共索引"删除"?

您如何确定您托管项目的公司的首席执行官将无法查看您的数据?

这些公司是否经过某种定期认证?或者整个交易基于信任和理解?

dvcs github bitbucket sensitive-data

3
推荐指数
1
解决办法
2029
查看次数

使用Bitbucket配置Jenkins

我似乎一直试图将Jenkins(Ubuntu的EC2 AWS实例)与Bitbucket联系起来.

每当我尝试构建我的项目时(我已经在Jenkins上安装了git插件)我得到了......

Building in workspace /var/lib/jenkins/jobs/Google adwords/workspace
Checkout:workspace / /var/lib/jenkins/jobs/Google adwords/workspace - hudson.remoting.LocalChannel@2c473996
Using strategy: Default
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo 'origin' : Could not clone git@bitbucket.org:DAVID99WORLD/assessme.git
hudson.plugins.git.GitException: Could not clone git@bitbucket.org:DAVID99WORLD/assessme.git
    at hudson.plugins.git.GitAPI.clone(GitAPI.java:268)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1122)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1064)
    at hudson.FilePath.act(FilePath.java:842)
    at hudson.FilePath.act(FilePath.java:824)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1064)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1256)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:589)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:494)
    at hudson.model.Run.execute(Run.java:1502)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:236)
Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin git@bitbucket.org:DAVID99WORLD/assessme.git /var/lib/jenkins/jobs/Google …
Run Code Online (Sandbox Code Playgroud)

java git bitbucket jenkins

3
推荐指数
1
解决办法
8599
查看次数

Git:在"git rm"之后推送更改

我删除了一个文件git rm test,目前这是输出git status .

Noob@Noob:/media/data/bitbucket/pythonscripts$ git status .
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       deleted:    test
#
Run Code Online (Sandbox Code Playgroud)

现在,当我尝试使用git push它来推动我的回购中的更改时说Everything up-to-date.我理解通常需要先按推送而add不是commit推送,但在我的情况下,我添加了什么,因为我已经删除了文件.

此外,如果我这样做git commit -m "commit message"将覆盖我的所有提交,因为目前我没有文件附加此提交.

git github bitbucket

3
推荐指数
1
解决办法
5899
查看次数

在bitbucket ssh连接期间,linux终端上的"错误配置选项".

我想开始使用bitbucket,我已经完成了教程的步骤来连接到他们的服务器.链接

配置文件总是出错.我使用的是ubuntu 12.10.

root@peter-VPCEH1M1E:/home/peter/Dropbox/C++/Qt/sql/.git# git push git@bitbucket.org:erbal/sql.git
/root/.ssh/config: line 1: Bad configuration option: [core]
/root/.ssh/config: line 2: Bad configuration option: repositoryformatversion
/root/.ssh/config: line 3: Bad configuration option: filemode
/root/.ssh/config: line 4: Bad configuration option: bare
/root/.ssh/config: line 5: Bad configuration option: logallrefupdates
/root/.ssh/config: line 6: Bad configuration option: ignorecase
/root/.ssh/config: line 7: Bad configuration option: [remote
/root/.ssh/config: line 8: Bad configuration option: fetch
/root/.ssh/config: line 9: Bad configuration option: url
/root/.ssh/config: line 10: Bad configuration option: [branch
/root/.ssh/config: line …
Run Code Online (Sandbox Code Playgroud)

git bitbucket

3
推荐指数
1
解决办法
2万
查看次数

我弄乱了我的存储库吗?

一点git新手,我想确保我没有对我的git存储库造成任何重大损害.基本上,我曾经git reset --hard HEAD恢复到我之前的提交,因为我搞砸了一些事情.然后我意识到我不想失去我所做的一切,所以我做了一个git reset HEAD@{1}.哪个似乎没有任何帮助.然后我试了一下git reset --hard ORIG_HEAD.

所以我想,无论如何,我会做一点点的工作.我做了之后,我去推它,我一直收到这个错误:

更新被拒绝,因为您当前分支的提示落后

我尝试了,git pull origin并且由于一些我无法完全记住的原因而不允许它.

最后,我刚刚做了一个git push -f,它似乎工作正常,我的项目再次运作良好.

git reflog如果它有帮助,这是我的输出:

在此输入图像描述

我只是好奇,如果我真的搞砸了我推到的BitBucket存储库或我能够再次恢复的本地存储库.有没有办法检查我的git repo是否仍然正常运行?

编辑:BitBucket还说我"剥离"了一个提交......

git github bitbucket

3
推荐指数
1
解决办法
452
查看次数

Bitbucket:git push错误:pack-objects死于信号13

我试图将我的本地仓库推到Bitbucket上的原始分支,并且一直没能推动它.错误显示如下.

Counting objects: 2309, done.
Delta compression using up to 4 threads.
Connection to bitbucket.org closed by remote host.
fatal: The remote end hung up unexpectedly
Compressing objects: 100% (2295/2295), done.
error: pack-objects died of signal 13
error: failed to push some refs to .... 
Run Code Online (Sandbox Code Playgroud)

我已经试过了

git config http.postBuffer 5242880
Run Code Online (Sandbox Code Playgroud)

结果显示同样的错误.我也尝试将我的设置从https更改为ssh,但仍然存在相同的错误.

我想这可能是因为我将大文件推送到我的远程存储库.我没有要求任何一个月的更新,只做了拉取请求来更新我的本地仓库.

git push bitbucket

3
推荐指数
1
解决办法
6093
查看次数

Git克隆一个分支,而不是主人

我使用Git Bash作为bitbucket.我已经创建了一堆,我推了一些提交,其他人推动了master中的提交作为例外.现在我在不同的机器上.我想克隆或下载我的分支的最新提交的解决方案,而不是主人?我怎样才能做到这一点?

git branch bitbucket git-clone git-bash

3
推荐指数
3
解决办法
2万
查看次数

Git:将存储库移至另一个存储库的子文件夹

我有两个单独的git存储库(位于BitBucket中)Repo ARepo B。我想Repo B进入的子文件夹Repo A。我还需要确保Repo B保留提交历史记录等,并且不会丢失。

如何使用git实现此目的?

git bitbucket

3
推荐指数
1
解决办法
1737
查看次数

Atlassian比特桶和竹子之间的区别

Atlassian比特桶和竹子应用之间有什么区别?我可以看到Bamboo是CI / CD工具,而bitbucket是版本控件,但是我想您可以将bitbucket用作CI / CD工具,为什么我们需要Bamboo?

git version-control bitbucket bamboo

3
推荐指数
1
解决办法
749
查看次数