從克隆的儲存庫推送
接下來,我們現在可以從我們剛才創建的克隆儲存庫中推送。
首先,導航到您機器上新的tutorial2
資料夾。將下面的粗體文本新增到sample.txt
,並按照您在原始教程儲存庫中所做的相同方式提交更改。
Anyone can learn Git with this tutorial and Backlog
add: Register a change in an index
當您本地儲存庫分支的歷史日誌更新時,它會領先於遠端儲存庫分支。

現在將新提交推送到遠端儲存庫。
單擊工具列上的「Push」圖示。

確保選取了 main 勾選方塊,然後單擊「OK」繼續。

現在main
和origin/main
處於同一級別。這意味著遠端儲存庫現在已更新為最新更改,且現在與我們的本地儲存庫同步。

您現在將在 Backlog 的 Git 頁面上的「Recent Updates」下找到最新推送的提交。

在下一個章節中,我們將更詳細地介紹分支,但現在這是以下每個參考指向的位置:
- origin/main:指向
origin
的主要分支,通常是遠端儲存庫。 - origin/HEAD:指的是
origin
的目前提交,即遠端儲存庫。在大多數情況下,本地儲存庫在執行克隆時將指向與origin/HEAD
相同的位置 (相當於origin/main
)。但是,如果您退出到不同的遠端分支,情況就不會如此。 - main:指向本地儲存庫的主分支。