Skip to main content
  1. Learn
  2. Software Development
  3. Guides
  4. Git tutorial
  5. Git basics
  6. What is Git
  7. A basic Git workflow
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

A basic Git workflow

The basic flow of any Git project goes as such:

  1. Modify your files in the working tree.
  2. Stage the changes you want to include in the next commit.
  3. Commit your changes.

Step by step, that workflow might look like this:

  1. Initialize a repository: To start using Git for version control in a project, you first initialize a Git repository.
  2. Work on your files: Once the repository is initialized, you start working on your project files in the working directory, where you create, edit, and delete files as part of your project development.
  3. Stage changes: When you’re ready to save these changes in Git, you stage them to tell Git to include those specific changes in the next commit.
  4. Commit changes: Once the changes are staged, you commit them to the Git repository to record the changes and package them with a commit message explaining what was done.
  5. Review history: As you continue to work on your project and make commits, you review the history of commits in the git log that displays a chronological list of all commits made in the repository, along with their commit messages.
  6. Branching: You work on different features or versions of your project simultaneously using branches, i.e., separate lines of development that diverge from the main project line.
  7. Merge changes: Once you've completed work on a branch, you merge it back into the main branch. This integrates changes from the branch into the main line of development.
  8. Push and pull from remote: You sync changes with a remote repository to share your changes or get updates from others.

Mastering these basic concepts forms a foundation for effectively using Git in various development projects.

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life