Git Workflow for Daily Development

By: on Mar 6, 2025

When working on a project, I typically follow these same steps over and over throughout the day. This is my standard Git workflow to stay in sync with the main branch while making changes:

  1. Check out the master (or main) branch
    Start by making sure you’re working with the latest version of the main branch.

    git checkout master
    
  2. Pull the latest changes
    Get the most up-to-date version of the master branch from the remote repository.

    git pull origin master
    
  3. Check out your feature branch
    Create a new feature branch from the latest master or main branch.

    git checkout -b feature-branch-name
    
  4. Stage your changes
    After making updates to your code, stage the changes to be committed.

    git add .
    
  5. Commit your changes
    Commit your staged changes with a clear message describing what you've done.

    git commit -m "Describe your changes here"
    
  6. Push to the remote repository
    Send your changes to the remote repository so others can see and work with them.

    git push origin feature-branch-name
    

This quick routine helps keep your local and remote branches in sync, ensures you’re working on the latest version, and keeps your commits organized and shareable. You’ll find yourself running through these steps frequently throughout the day!