Skip to main content
  1. Learn center
  2. Software Development
  3. Guides
  4. Git tutorial
  5. 如何使用 Git
  6. 如何在 Command Line 中使用 Git
  7. 从存储库拉取
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

从存储库拉取

现在让我们把最新的修改 (我们刚才在前一个步骤推送的修改) 从远程存储库拉取到我们的本地存储库 (即tutorial目录)。

既然我们的远程存储库与tutorial2中的更改是最新的,让我们拉取更改,并同步我们的初始存储库目录tutorial

若要执行拉取,请使用 git pull 命令。如果您不包含存储库名称,将在别名为“origin”的存储库上执行拉取。

$ git pull origin main
  Username:
  Password:
  From https://example.backlog.com/git/BLGGIT/tutorial.git
  * branch            main     -> FETCH_HEAD
  Updating ac56e47..3da09c1
  Fast-forward
  sample.txt |    1 +
    1 files changed, 1 insertions(+), 0 deletions(-)

使用 git log 命令验证历史记录是否已更新。

$ git log
  commit 3da09c1134a41f2bee854a413916e4ebcae7318d
  Author: username
  Date:   Thu Jul 12 18:02:45 2022 +0900

  append description of the add command

  commit ac56e474afbbe1eab9ebce5b3ab48ac4c73ad60e
  Author: username
  Date:   Thu Jul 12 18:00:21 2022 +0900

      first commit

新的提交现在列在这个存储库的历史日志下。

打开sample.txt文件,并检查内容。

Anyone can learn Git with this tutorial and Backlog
add: Register a change in an index

您将看到add: Register a change in an index已添加到内容中。

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life