Key Concepts

Review core concepts you need to learn to master this subject

The Main Branch

$ git init Initialized empty Git repository in /home/ccuser/new-project/.git/ $ echo "Hello World!" >> hello.txt $ git add hello.txt $ git commit -m 'initial commit' [master (root-commit) bb0e565] initial commit 1 file changed, 1 insertion(+) create mode 100644 hello.txt $ git branch * master

In Git, the main project is completed on the main branch. Making your first commit in a new git repository will automatically create a main branch. Create new branches from the main branch to develop new features for a project. These branches can be merged into main at a later time to incorporate the new features. You can use git branch to check what branch you’re on.

The GitHub Flow
Lesson 1 of 1
  1. 1
    In this lesson, we’ll discuss the flow of using GitHub with your code development process. When working on a project, things can scale rather quickly. Following a specific workflow allows the proje…
  2. 2
    Whenever we’re working on a team creating multiple versions of a project code, it’s important to isolate each teammate’s work in order to avoid any conflicts. With Git, each teammate can create the…
  3. 3
    Let’s assume you were recently assigned to a team to develop a feature for an app. You clone (download) the entire app repository from GitHub and create a branch for your feature of the main branch…
  4. 4
    At this point, your work is ready to be reviewed before it’s integrated into the official project. Pull Requests on GitHub allow collaborators to review and give feedback on proposed code changes…
  5. 5
    Once you’ve created a pull request, other members in your team can review it up on GitHub. The pull request should include a description and GitHub will display all the files with the changes crea…
  6. 6
    Once changes are merged, in order to keep things organized and managed, it’s imperative to only keep active branches and delete the closed ones. With that in place, this wraps up the flow of work…

How you'll master it

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

Pro Logo