CSC Git Guide

Git Workflow

Git Workflow

In this section, we describe the typical Git workflow and indicate where users commonly have trouble.

One-Time Steps

  1. First, install Git tools.
  2. Next, configure your git installation to set your username and password.

Steps for Working on Projects

  1. Make sure you have completed the one-time steps for installing and configuring Git on your machine.
  2. When you first begin working on a project, you will need to clone your NCSU GitHub repository.
  3. Next, you will either need to:
  4. If your project doesn’t already include a .gitignore file, create a .gitignore file.
  5. Typically, you will now begin writing code or continue editing existing code.
  6. If you are working on a team that shares a common repository, you should frequently pull any updates your team members push to the team’s NCSU GitHub repository. If the pull results in CONFLICTING code, you will need to resolve merge conflicts.
  7. Once you are ready to save a snapshot of your code to your repository, you need to add the files you want to save in the snapshot to your staging area/index.
  8. After staging your commit by adding files to your staging area/index, you need to commit your staged snapshot to your local repository.
  9. To send your local repository’s commit snapshots to your NCSU GitHub remote repository, you will need to push your local commit snapshots. If you experience fetch-first or non-fast-forward errors, try to pull before you push.
  10. Repeat with step 4 to continue working on your project.