Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6224811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:43:58+00:00 2026-05-24T08:43:58+00:00

I am in the process of developing a Git workflow for a web app

  • 0

I am in the process of developing a Git workflow for a web app project I am working on. I have used Git for several years, but only as a solo developer. I have put a set of procedures together, and yesterday ran across this article on HN: http://sandofsky.com/blog/git-workflow.html

Based on the article I have adjusted my procedures and would appreciate some feedback. I want to make sure I am interpreting the article correctly and not contributing to issues down the road. Based on the article in question, and the desire to provide good working standards, are there any issues with the following procedures?


Basics

  • master branch – The main, working branch into which all code
    development is merged. This represents the most recent additions to
    the codebase from individual development branches.
  • ‘dev_’ branches – Local, private development branches should be used for developing new
    features. If you need to push the branch to the server (so you can
    switch easily between computers) please make sure that the dev branch
    name includes the user name, like ‘dev_andy_authentication’.
  • staging branch – Before deployment of certain code from the master branch,
    the code must be tested in an environment that matches the production
    environment as closely as possible. Code from the master branch is
    merged into the staging branch, tested, and, once it passes tests, is
    eligible for production.
  • production branch – Stable code from the staging branch is integrated into the production branch, tagged with a release version number, then deployed to the production server(s).

Development

Branch: master

  • Use local, private feature branches to separate code:
    • Switch to ‘master’ branch: git checkout master
    • Create a new, private feature branch: git checkout -b dev_newfeaturename
    • Make feature additions.
    • Stage changes: git add .
    • Commit changes in ‘dev_newfeaturename’: git commit -m “commit description”
  • To integrate changes from ‘dev_newfeaturename’ branch:
    • Switch to ‘master’ branch: git checkout master
    • Check for remote changes to ‘master’: git pull –rebase origin master
    • If changes in ‘dev_newfeaturename’ branch are relatively small:
      • Integrate changes from ‘dev_newfeaturename’ branch into master: git merge –squash dev_newfeaturename
      • Write a detailed commit message of changes implemented from ‘dev_newfeaturename’ branch: git commit -v
    • If changes in ‘dev_newfeaturename’ branch are more complex, requiring multiple commits to remain in the history:
      • Switch to ‘dev_newfeaturename’ branch: git checkout dev_newfeaturename
      • Reintegrate any changed ‘master’ code into ‘dev_newfeaturename’ branch: git rebase –interactive master
      • To cleanup history by combining commits, change the operation from “pick” to “squash”, which squashes the second commit into the first
      • Switch to ‘master’ branch: git checkout master
      • Push changes to remote ‘master’: git push origin master
    • Check for remote changes to ‘master’: git pull –rebase origin master
    • Push all changes to ‘master’ back to the server: git push origin master
  • ‘Master’ becomes the working tree of all currently developed features.
  • Periodically pull ‘master’ changes from remote: git pull –rebase origin master

Staging

Branch: staging

  • Once a release of a certain number of features/bug fixes has been scheduled, ensure that ‘master’ is functioning properly then merge into ‘staging’ by:
    • Switch to ‘staging’ branch: git checkout staging
    • Integrate changes from ‘master’ into ‘staging’: git merge –no-ff master
    • Push ‘staging’ to remote repo: git push origin staging
  • Deploy ‘staging’ branch to staging server and test rigorously – staging server should replicate production environment as closely as possible.
  • If any testing fails, return to ‘master’ branch, fix any associated issues, and restart the Staging process.
  • If all testing passes, proceed to Production process.

Production

Branch: production

  • Once code in the staging branch has been tested and has passed, switch to the ‘production’ branch: git checkout production
  • Integrate changes from ‘staging’ into production: git merge –no-ff staging
  • Tag code with sequential release version number: git tag -a 0.1
  • Push ‘production’ to remote repo: git push origin production
  • Deploy ‘production’ branch to production server and test to ensure proper deployment.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:43:58+00:00Added an answer on May 24, 2026 at 8:43 am

    You wrote:

    If changes in ‘dev_newfeaturename‘ branch are more complex, requiring multiple commits to remain in the history:

    • Switch to ‘dev_newfeaturename’ branch: git checkout dev_newfeaturename
    • Reintegrate any changed ‘master’ code into ‘dev_newfeaturename’ branch: git rebase --interactive master
    • To cleanup history by combining commits, change the operation from “pick” to “squash”, which squashes the second commit into the first
    • Switch to ‘master’ branch: git checkout master
    • Push changes to remote ‘master’: git push origin master

    I think you forget the fast-forward merge of ‘dev_newfeaturename‘ into ‘master’:
    The rebase allows you to replay ‘dev_newfeaturename‘ on top of ‘master’, cleaning up the commits in that process. That is good.
    But if you want to push back master to the remote, master needs those cleaned commits in its history: `git merge dev_newfeaturename


    Regarding a branch per development state (staging, prod), I wouldn’t recommend that approach, unless you are actively producing new commits in those branches.
    Remember the sentence about no-ff in the article you reference:

    The only remaining argument for –no-ff is “documentation.”
    People may use merge commits to represent the last deployed version of production code.
    That’s an antipattern. Use tags.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a web site project that is currently tracked in svn but
We are in the process of developing a .NET based IIS hosted web application
I am in the process of developing a web application that consists visually of
We are in the process of developing several WLST (WebLogic Scripting Tool) scripts and
We are developing an iphone app that needs to process audio data in real
I'm developing a java EE web app using JSF with a shopping cart style
We're currently in the process of developing a web-based application which will require the
I'm in the process of developing a social network site. And been thinking of
I'm in the process of developing a multi-tiered financial processing application in Java using
I am in the process of developing a large ASP.NET MVC application. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.