从克隆的存储库推送
接下来,我们现在可以从我们刚才创建的克隆存储库中推送。
首先,将下面的粗体文本添加到新克隆目录中的sample.txt
文件,并提交更改。
Anyone can learn Git with this tutorial and Backlog
add: Register a change in an index
当您本地存储库分支的历史日志更新时,它会领先于远程存储库分支。

现在将新提交推送到远程存储库。
右键单击“tutorial2”目录,然后单击“Push”。

单击“OK”进入下一个屏幕。
再次单击“OK”。

以下屏幕显示正在进行的推送。在完成后,单击“Close”结束。

从右键单击菜单中选择“TortoiseGit” > “Show log”。现在main
和origin/main
处于同一级别。
这意味着远程存储库现在已更新为最新更改,并与本地存储库同步。
您现在将在 Backlog 的 Git 页面上的“Recent Updates”下找到最新推送的提交。

在下一个章节中,我们将更详细地介绍分支,但现在这是以下每个参考指向的位置:
- origin/main:指向
origin
的主要分支,通常是远程存储库。 - origin/HEAD:指的是
origin
的当前提交,即远程存储库。在大多数情况下,本地存储库在执行克隆时将指向与origin/HEAD
相同的位置 (相当于origin/main
)。但是,如果您签出到不同的远程分支,情况就不会如此。 - main:指向本地存储库的主分支。