2015-07-10 130 views
0

我在本地系統中有github項目openstack,現在我已經做了一些更改,我想將其推送到https://bitbucket.org存儲庫。我想將kilo分支推送到我的遠程存儲庫。如何推出退出git項目(git-hub)到位bucker?

當嘗試運行

git remote add origin https://[email protected]/user_name/my_project.git 

我收到以下錯誤。

致命:遠程原點已經存在。我運行了他們(比特鬥)提到的相同命令。 我不想刪除主人,請告訴我如何我的本地庫添加到比特鬥..

[[email protected] horizon]$ git branch 
    master 
    stable/icehouse 
    stable/juno 
* stable/kilo 


[[email protected] horizon]$ git branch -a 
    master 
    stable/icehouse 
    stable/juno 
* stable/kilo 

回答

2

以下是對從GitHub遷移到到位桶

1.首先使用命令

git clone <repository url> 

2.After克隆庫克隆到本地計算機的步驟是成功的分離您的git集線器庫

git remote -v 
git remote rm origin 

3.分離您的github存儲庫後。去你的bitbucket並創建一個倉庫,找到選項I have code that I want to import並點擊它。

4.它會給你你需要從你的項目目錄控制檯運行的命令。這些命令將如下所示

git remote add origin ssh://[email protected]/urRepository/urproject.git #you would get your repo link from bitbucket. 
git push -u origin master # to push changes for the first time 

它將完成。

1

您有現有的遠程命名origin,您可以通過使用檢查,

git remote -v 

您可以刪除/重命名現有的遠程或您可以創建一個新的遠程。

git remote add mynewremote https://[email protected]org/neelabh_singh/my_project.git 

如果你想將它命名爲origin然後就重命名/刪除現有的起源,

git remote rename origin <new_name_for_old_origin> 

OR

git remote remove origin 
2

使用不同的遠程

git remote add bitbucket https://[email protected]/neelabh_singh/my_project.git 
git push bitbucket stable/kilo:kilo