用 Git 进行版本控制

Learn to track and manage changes

初级

大约 4 个星期

6小时每周 (自主学习)

加入成千上万的全球学员

开始免费课程

加入课程
免费
可享受
课程视频
实战练习
初级

大约 4 个星期

6小时每周 (自主学习)

加入成千上万的全球学员

课程概述

This course covers the essentials of using the version control system Git. You'll be able to create a new Git repo, commit changes, and review the commit history of an existing repo. You'll also learn how to keep your commits organized using tags and branches and you'll master the art of merging changes by crushing those pesky merge conflicts. Oh no! Was a mistake made along the way? Learn how to edit commits, revert changes, or even delete commits.

为什么学习这门课程?

Version control is an incredibly important skill that every developer should master, and Git is one of the most popular version control systems used in the workforce. Whether you're working as a solo developer or working with a team, being able to track the history of a project is paramount. Tracking versions of your code will help you keep a record of progress and allow you to "undo" any blunders that occur along the way. This is incredibly important in a profession where ~96% of developers say they work on a team of engineers all working on the same code and ~67% of developers report having to check-in changes in their code at least once a day.

先修要求

This course is ideal for developers of all skill levels. Experience with the command line is beneficial, but not required.

查看使用优达学城的技术要求

学习计划

In this course, you'll learn how important version control is to professional development. You'll install the Git shell command and configure it. You'll use the git command to create repositories that are local to your machine. Using this same command, you'll copy existing Git repositories to your computer. You will learn about how important it is to check the status of a repository. You'll track changes to projects using small, focused packages called commits. You'll learn how to navigate existing commits and the importance of providing clear, descriptive commit messages. You'll work on the same project in different situations using branches. Using the git command, you'll merge branches together and resolve any merge conflicts if they should arise. Lastly, if there are any issues with commits, you'll learn how to go back in time to alter, reverse, or totally delete commits.

Lesson 1: Purpose & Terminology

  • Learn why developers use version control and discover ways you use version control in your daily life
  • Get an overview of essential Git vocabulary
  • Configure Git using the command line

Lesson 2: Create a Git Repo

  • Create your first Git repository with git init
  • Copy an existing Git repository with git clone
  • Review the current state of a repository with the powerful git status

Lesson 3: Review a Repo's History

  • Review a repo's commit historygit log
  • Customize git log's output using command line flags in order to reveal more (or less) information about each commit
  • Use the git show command to display just one commit

Lesson 4: Add Commits to a Repo

  • Master the Git workflow and make commits to an example project
  • Use git diff to identify what parts of a file have been changed in a commit
  • Learn how to mark files as "untracked" using .gitignore

Lesson 5: Tagging, Branching, and Merging

  • Organize your commits with tags and branches
  • Jump to particular tags and branches using git checkout
  • Learn how to merge together changes on different branches and crush those pesky merge conflicts

Lesson 6: Undoing Changes

  • Learn how and when to edit or delete an existing commit
  • Use git commit's --amend flag to alter the last commit
  • Use git reset and git revert to undo and erase commits

讲师与合作伙伴

Richard Kalehoff

Richard Kalehoff

作为一名劲头十足的程序员和求知者,Richard Kalehoff 在教师行业找到了自己的激情和抱负。在优达学城担任课程开发人员的过程中,他对开发和教学都无比的喜爱。在获得计算机科学领域学位后,他做出了明智的决策,进入了 HTML、CSS 和 JavaScript 领域。在超过 7 年的时间内,他都一直在一家国际非营利组织工作,负责多项工作,包括前端网络开发、后端编程和数据库及服务器管理。在从弗罗里达大学的网络设计和在线通信硕士课程中毕业并获得大众通信学位前,他就受到弗罗里达大学的邀请,成为该校的一名教职工。即使要规划、构建和开发课程,他还是会抽出时间去加州的乡下走走,欣赏原野风光。

官方微信公众号二维码

优达学城(Udacity)微信