Skip to main content
  1. Learn center
  2. Software Development
  3. Guides
  4. Git tutorial
  5. 如何使用 Git
  6. 如何在 Mac 中使用 Git
  7. 提交文件
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

提交文件

我们将添加一个新文件,并将其注册在我们刚才创建的存储库中。

使用以下文本内容在该目录中创建一个名为sample.txt的文件。

Anyone can learn Git with this tutorial and Backlog

在 Sourcetree 的书签窗口中双击tutorial存储库,来弹出存储库操作窗口。如果目录中有任何新添加或编辑的文件,将显示在工作树文件检查器的左下角。

因为我们刚才将sample.txt文件添加到tutorial目录中,所以我们看到它列在那里。

Repository screen

右键单击“sample.txt”文件,并选择“Add to Index”。该文件将移动到上面的“Files staged in the index”列表中。

Click Add to Index

单击工具栏上的“提交”图标,输入提交消息 (例如,“first commit”),然后单击“Commit”。

Enter commit message and click commit button

完成后,您将在“main”分支历史记录中找到提交。您可以通过单击左侧菜单中的“History”来验证提交是否成功。

The commit is added

接下来,您已准备好与您的团队共享存储库。

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life