Coursera 笔记

Module 02 · Git Commands and Managing GitHub ProjectsGit 命令与 GitHub 项目管理

Summary: Git Workflows with Git Commands总结:Git 命令与工作流程

Coursera ↗

In this module, you learned that:
在这个模块中,你学习了以下内容:

  • GitHub has over 100 million repositories. You can clone a repository and sync changes back to the original. You can also fork a repository and use it as the base for the new project or work on that project independently.
    GitHub 拥有超过 1 亿个仓库。您可以克隆一个仓库并将更改同步回原始仓库。您还可以分叉一个仓库,将其作为新项目的基础或独立在该项目上工作。
  • The steps included in a GitHub workflow are:
    GitHub 工作流程中包含的步骤有:
    • Clone the remote repository or initialize a Git repository.
      克隆远程仓库或初始化 Git 仓库。
    • Move files to a staging area.
      将文件移动到临时区域。
    • Perform an initial commit.
      执行初始提交。
    • Create a branch and work on it.
      创建一个分支并在此工作。
    • Add files to the staging area and commit.
      将文件添加到暂存区并提交。
    • Push local commits to the remote repository.
      推送本地提交到远程仓库。
    • Create a pull request for review and merging.
      创建一个拉取请求以供审查和合并。
    • Use the pull operation to update the local repository.
      使用拉取操作更新本地仓库。
  • Multiple roles are involved in managing a project: Developer, Integrator, and Repository Administrator.
    多个角色参与项目管理:开发者、集成者和存储库管理员。
    • A Developer working in a group project uses commands like git clone, git pull, git fetch, git push, and git request-pull in addition to the ones needed by a standalone developer.
      一个在团队项目中工作的开发者除了需要独立开发者所需的命令外,还会使用 git clone、git pull、git fetch、git push 和 git request-pull 等命令。
    • An Integrator in a group project reviews and integrates changes made by others. Integrators use commands like git pull, git revert, and git push in addition to the ones needed by participants.
    • Repository Administrators structure how the repository is organized and how users interact with the repository. They also configure the servers needed for accessing the web services and documentation, define email and index settings, and manage the look and feel of the application.
      存储库管理员结构化存储库的组织方式和用户与存储库的交互方式。他们还配置访问 Web 服务和文档所需的服务器,定义电子邮件和索引设置,并管理应用程序的外观和感觉。
  • The following table shows various Git commands:
    以下表格展示了各种 Git 命令:
git init git checkout git revert git-format-patch git fetch upstream
git status git merge git config --global user.email git-request-pull git merge upstream/main
git add . git clone git config --global user.name git-send-email git pull upstream
git commit git pull git remote -v git-am git web
git log git push git remote rename git-daemon git-instaweb
git reset git version git remote add origin git remote -v git-pull downstream
git branch git diff git-remote git remote add upstream git-rerere