Key Concepts

Review core concepts you need to learn to master this subject

Git Collaboration Workflow

A common Git collaboration workflow is:

  1. Fetch and merge changes from the remote
  2. Create a branch to work on a new project feature
  3. Develop the feature on a branch and commit the work
  4. Fetch and merge from the remote again (in case new commits were made)
  5. Push branch up to the remote for review

Steps 1 and 4 are a safeguard against merge conflicts, which occur when two branches contain file changes that cannot be merged with the git merge command.

Git Teamwork
Lesson 1 of 1
  1. 1
    So far, we’ve learned how to work on Git as a single user. Git also offers a suite of collaboration tools to make working with others on a project easier. Imagine that you’re a science teacher, d…
  2. 2
    Sally has created the remote repository, science-quizzes in the directory curriculum, which teachers on the school’s shared network have access to. In order to get your own replica of __sci…
  3. 3
    Nice work! We have a clone of Sally’s remote on our computer. One thing that Git does behind the scenes when you clone science-quizzes is give the remote address the name origin, so that you …
  4. 4
    After you cloned science-quizzes, you had to run off to teach a class. Now that you’re back at your computer, there’s a problem: what if, while you were teaching, Sally changed the __science-qu…
  5. 5
    Even though Sally’s new commits have been fetched to your local copy of the Git project, those commits are on the origin/master branch. Your local master branch has not been updated yet, so you c…
  6. 6
    Now that you’ve merged origin/master into your local master branch, you’re ready to contribute some work of your own. The workflow for Git collaborations typically follows this order: 1. Fetch and…
  7. 7
    Now it’s time to share our work with Sally. The command: git push origin will push your branch up to the remote, origin. From there, Sally can review your branch and merge your work into the…
  8. 8
    Congratulations, you now know enough to start collaborating on Git projects! Let’s review. * A remote is a Git repository that lives outside your Git project folder. Remotes can live on the w…

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo