Learning Git-flow!
Publish date: Apr 10, 2021Tags: Efficiency Tools
Hands-on Git-flow
Git-flow bundles Git commands into work flows so that we can easily use version control.
First, I initiate a repository named test-git-flow and push my test file to the repo.
Then init the git flow in this project.
This step actually commits nothing.
New Features
Now create a new branch to add new features.
After adding new features to the test file, I finished the new feature. But I need to run git push before git flow finish, or the github won’t update the new branch feature/rss-feed. So does the develop branch.
After finishing the feature, the branch will be automatically deleted from GitHub and merged into development branch.
Bug fixing
The “line” is misspelled in both main and develop branched. Now I will try hot fix commands.
The bug has been fixed in the hotfix branch. Then finish this fixing.
Then the hotfix branch has been merged into master and developement branches and deleted.
The git flow operation violates atomicity. It merge hotfix into master first, then dev.
[2021.05.13 Updated] Learn git rebase
git pull = git fetch + git merge.
Git merge operation does not save the history of commits. it’s better to use git fetch + rebase.
Do note that after fetching a remote repository/branch, we should rebase based on “origin/**” branch.
“git branch” will show the difference.