2017-06-27 40 views
0

昨天我從家裏的電腦上對Github上的一個項目做了一些修改。 現在我剛剛從我的工作計算機上對同一個項目做了一些新的更改。爲什麼Github不顯示我的Git編輯?

我試圖提交與git push推動,但混帳說:

error: failed to push some refs to 'https://github.com/...' 
hint: Updates were rejected because a pushed branch tip is behind its remote 
hint: counterpart. If you did not intend to push that branch, you may want to 
hint: specify branches to push or set the 'push.default' configuration variable 
hint: to 'simple', 'current' or 'upstream' to push only the current branch. 

所以我不得不使用下面的命令:

git push --set-upstream origin BEHST;

推去好了,但我看不到我的我的Github網頁上的更改。

有誰知道爲什麼?

如何將我的git更改傳播到我的Github網頁?

+0

只是爲了確認,你在GitHub上查看正確的分支嗎?它默認爲「默認」分支,通常是「主」。 – roryrjb

+0

它看起來像你推到了一個分支。您可以使用GitHub上的「分支」下拉菜單查找BEHST。如果你想在「master」分支中使用它,你可以在GitHub中做一個pull請求,或者手動[merge](https://git-scm.com/docs/git-merge)。 – vcsjones

+0

@roryrjb我在一個分支 –

回答

0

在推送之前是否更新過項目代碼?

在推動任何東西之前,您需要git pull origin master

我認爲你使用origin作爲遠程名稱。

在推送之前,您需要拉動以使您的本地存儲庫保持最新,然後再推送某些內容。這有助於本地解決衝突。

+0

我試過了,但它說'拉不可能,因爲你有沒有合併的文件。 請修復它們在工作樹中,然後根據需要使用'git add/rm ' 來標記解析度,或者使用'git commit -a'。' –

+0

那麼這將幫助您:https:// stackoverflow .COM /問題/ 26376832 /爲什麼此結果混帳說,拉是 - 不可能,因爲,你具備的,未合併檔案 –