2011-10-26 125 views
9

好的,希望這對你應該很容易。我是git,BitBucket的新手,並且對版本控制也有些新意,我會錯過一些對你來說很明顯的東西。用Git掙扎,無法推送到遠程BitBucket存儲庫

所以這就是我所做的:我已經在我的機器上安裝了git並設置了我的全局變量。在BitBucket上設置一個新的回購。然後:

$ git clone https://[me]@bitbucket.org/[me]/[my_project].git 
Cloning into [my_project]... 
Password: 
warning: You appear to have cloned an empty repository. 

$ git status 
# On branch master 
# 
# Initial commit 
# 
# Untracked files: 
# (use "git add <file>..." to include in what will be committed) 
# 
# index.html 
nothing added to commit but untracked files present (use "git add" to track) 

完成。然後我在本地創建一個新文件(index.html)。然後:

$ git add index.html 
$ git status 
# On branch master 
# 
# Initial commit 
# 
# Changes to be committed: 
# (use "git rm --cached <file>..." to unstage) 
# 
# new file: index.html 
# 

因此添加成功。然後:

$ git commit -m "Initial commit." 
[master (root-commit) 01d4120] Initial commit. 
1 files changed, 164 insertions(+), 0 deletions(-) 
create mode 100755 index.html 

已成功提交。

$ git push 
Password: 
Everything up-to-date 

輸入我的密碼aaaaaand ... Everything up-to-date ......它不推。我只是想直接從我的本地中繼線遠程中繼線。

對不起,如果這真的很明顯,但我對所有的東西都很陌生,我似乎無法找到任何信息,我只是通過'BitBucket 101'的步驟。謝謝。如果你有一個不同的遠程

git push origin master 

更改產地:

+0

請提供從創建新文件到「一切都是最新」的系統日誌。你有沒有檢查你網站上的bitbucket回購?沒有index.html文件? –

+0

使用命令行轉儲更新了問題,以便您可以看到發生了什麼。 – igneosaur

回答

16

你將不得不這樣做。

如果您有不同的分支,請更改主人。

+0

就是這樣!謝謝隊友,導遊沒有提到這一點。 – igneosaur

1

我不確定它是bitbucket.org還是GIT的問題。

克隆項目後。在您的本地配置中,您將遠程的原點設置。但沒有分支信息。所以你必須使用'$ git push origin'來做一次。之後。你可以簡單地使用'$ git push'。

'$ git push -v'將有助於發現問題。它打印出詳細信息。

相關問題