2013-02-20 31 views

回答

4

在unix shell中,您可以使用cURL;

curl https://api.bitbucket.org/1.0/repositories/{accountname}/{old_repo_name} --data "name=new_repo_name" -X PUT 

是否有可能爲用戶在私有倉庫進行身份驗證,但仍然只有管理員能夠執行:

curl https://USER:[email protected]/1.0/repositories/{accountname}/{old_repo_name} --data "name=new_repo_name" -X PUT 
1

據這裏的最新的API是正確的curl命令:

curl -X PUT --user username:password https://bitbucket.org/api/1.0/repositories/{accountname}/{repo_slug} --data "name=newRepoName" 

請注意,repo_slug是存儲庫名稱IN LOWER CASE。如果你沒有全部用小寫,你會得到不那麼富有表現力的答案「未找到」。

如果你不知道什麼是存儲庫蛞蝓執行下面的命令,它會顯示該用戶的信息,包括當前的存儲庫,並查找場「鼻涕蟲」

curl --user username:password https://bitbucket.org/api/1.0/user 
65

使用到位桶網站,你可以如下重命名回購:

  1. 轉到回購的概述頁面,通常https://bitbucket.org/username/oldname/overview
  2. 點擊菜單行的最右端的設置COG!
  3. 而不是1.和2.你可以鍵入'r'然後'a'管理。
  4. 更改Name字段中的名稱。
  5. 點擊Save repository details.

注意,改變回購的名稱將改變它的URL訪問過。以前的訪問是https://[email protected]/username/oldname.git但是,現在回購的URL /路徑將爲https://[email protected]/username/newname.git

您可以通過返回Overview頁面並將鼠標懸停在藍色的大藍色HTTPS按鈕上進行檢查。你的瀏覽器的底部會顯示如果您正在使用SourceTree您可以通過突出SourceTree當地回購和更新遠程的URL,然後

  1. 點擊Repository
  2. 點擊Repository Settings...,它現在指向https://[email protected]/username/newname.git

  3. 突出顯示包含遠程分支的行。通常origin https://[email protected]/username/oldname.git
  4. 點擊Edit
  5. 更新URL/Path字段。將「oldname.git」更改爲「newname.git」,其餘部分保持不變。因此,完整的路徑應該是https://[email protected]/username/newname.git
  6. 點擊OK
+6

如果您找不到設置按鈕,它目前在左下角「隱藏」。 – arni 2014-06-02 15:18:01

相關問題