Git Workflow for continuous development

We’ve been using Git for a node.js based web application. Our workflow is based on two brances, master and stable. We use master as the main development line and when we decide to release something, we go ahead and merge master into stable.

There are two servers, “staging” and “production”, whenever we push, a post receive hook deploys master to staging server and stable to production.

  • Git: Renaming a directory in a branch
  • Usage of updating a remote-tracking branch by a local branch
  • How to merge a branch to another branch in GIT?
  • git diff returns incorrect
  • How should I use the git branches?
  • The correct way to use Git?
  • The problem is, out master branch almost always has either experimental or non finished work on it. We need to push, in order to test the features on the actual server or just to show progress to administration. Now, when we need to merge to stable, it gets complicated.

    What would be the best approach for this? A staging branch? How are we gonna pick some of the features from staging to go into master or stable? Should we use small feature branches for everything? Even if it’s a single commit?

  • Git: How does checking out affect the repository?
  • git rm --cached still leaves files somewhere in repo
  • Detach many subdirectories into a new, separate Git repository
  • Sharing part of a git repo
  • Interfaces for microservice boundaries - how to import code?
  • How to push changes to branch?
  • 2 Solutions collect form web for “Git Workflow for continuous development”

    I think, No need to create small feature branches for everything , you can create new branch and pick the feature what you want from commit .

    Use Git Cherry-Pick to pick some of the features from staging to go into master or stable

    Often features span multiple commits, and in this case it would be advisable to create a staging branch, merge feature branches into that (or cherry-pick in the case of individual commits) and then merge with production and test the staging branch and push into the production branch.

    Git Baby is a git and github fan, let's start git clone.