Git configures the SSH Key

  • Enter ssh-keygen -t rsa -c ‘[email protected]’ on the git bash command line and press Enter
  • Open the file C:\Users\ administrator.ssh \id_rsa.pub
  • Add key to gitLab

Git-flow installation procedure

  1. Download and install git: git-scm.com/downloads
  2. Download getopt.exe:downloads.sourceforge.net/gnuwin32/ut…
  3. Download libintl3.dll:gnuwin32.sourceforge.net/downlinks/l…
  4. Download libiconv2.dll:gnuwin32.sourceforge.net/downlinks/l…
  5. Unzip the three downloaded zip files and place the three files in the bin directory in your Git installation directory into the bin folder

6. Obtain git flow

In the git directory open $git clone git bash -- recursive git://github.com/nvie/gitflow.git will generate a gitflow folder in the git directoryCopy the code
  1. Go to gitflow\contrib and open CMD
Run msysgit-install. CMD "d: Program Files\Git"Copy the code
  1. Git bash command window to execute Git flow

  1. Initialize git flow. Git flow init and press Enter

Git flow main branch

Master: always in production-ready state

  • Master branch. After all functions of the product are realized, the product will be released in master branch.
  • Read-only branches, which can only be merged from the Release or Hotfix branches and cannot be modified;
  • All push in the Master branch should be tagged for easy traceability.

The development status of the next release

  • Main development branch, based on the master branch clone, published to the next release;
  • Read only branch, feature branch complete, merge to Develop (do not push)
  • Develop the release branch.
  • Once the Release /hotfix branch is live, merge it into Develop and push it.

– feature: All new features will branch out from Develop and merge back to Develop

  • Function development branch, based on the Develop branch clone, for new requirements development;
  • After the function is developed, it will be merged into the Develop branch (it cannot be pushed to the remote central warehouse until it is officially launched).
  • Multiple features can exist at the same time for multi-functional synchronous development of the team, which is a temporary branch and can be deleted after development.

Release: Prepare the version to be released, only fixing bugs. From Develop, merge back to Master and Develop

  • Test branch, merge feature branch to Develop branch, clone from Develop branch;
  • As long as it is used to submit to testers for functional testing, if any bugs are found in the release branch during testing, the fix will be merged into the Develop/Master branch after the fix is completed and pushed to completion, and the label will be recorded.
  • Temporary branch, can be deleted after online.

Hotfix: You must fix the master immediately before the release. Exit from master, merge back to Master and Develop after completion

  • Patch branch, based on the master branch clone, is mainly used to fix bugs in the online version;
  • After the fix is complete, merge it into the Develop/Master branch and push it to record labels.
  • All hotfix branch changes go into the next release;
  • Temporary branch that can be removed after patch fix goes online.

Main working process:

  1. Initialize the project as git flow, create the master branch by default, and then pull the first Develop branch from master.
  2. Draw feature branches from develop for feature development (multiple feature branches are carried out simultaneously);
  3. After the feature branch is completed, it will be merged into Develop (not pushed, not tested yet, it will affect the development of other feature branches). The feature branch cannot be modified at present, and must be coded and modified from release branch.
  4. Pull test from the Develop release branch and fix bugs on the Release branch during test.
  5. Once the Release branch is live, merge it with Develop and Master and push it;
  6. After launching, I found a bug and pulled hotfix from master to fix the bug.
  7. Hotfix goes online after passing the test.

Common instructions:

Git checkout dev -b dev git checkout master git merge dev git merge dev Git branch -r Commit a new branch to the remote branch git push origin dev Delete the remote branch git push origin -d feature/1.1.0 Git fetch -p add a tag to git tag 1.1.0 Add a tag to git Git flow new branch git flow feature start 1.1.0 push local branch to remote git push --set-upstream origin feature/1.1.0 Git flow Feature finish 1.1.0Copy the code

Git and Git Flow

  1. Check to see if the local code has changed: git status
Clear changes to native code: git checkout -- SRCCopy the code

2. Test the project, end the feature branch and pull the release branch:

Git flow git flow init // end feature/1.0.0 branch Git flow feature finish 1.0.0 Git flow release start 1.0.0 // the local code pushes to the remote branch (which will let you establish a connection) git push // the local and remote release branches establish a connection git push - set - upstream origin release / 1.0.0Copy the code