Source From Here
Preface
I’m posting a doc that my coworker (Neha K.) gave me permission to repost. It’s the set of instructions my company follows to manage our source control and development environment. The basic idea is that we always branch to start development on a new feature or work on a bug.
Git Development Process
This is the process we follow for development with Git. Its based on Vincent Dreissen’s “A successful Git branching model”, please read that for a more detailed understanding of the process but keep in mind it has been modified a little to suit our needs.
Main branches
2 main long running active branches are:
Naming convention
Feature development
Its recommended to create a feature branch off of develop for any feature development. If the feature is small enough, it can be done directly on develop – that's at the discretion of the developer. But if the feature is for a future release and not the very next one, then a feature branch should be used. Here are steps for developing on a separate feature branch.
Create the feature branch
Checkout develop branch
Get the latest from develop
Create the feature branch off of develop and switch to the new branch
Push the feature branch to central repo
Commit/push to the feature branch as frequently as you like.
Merge develop into the feature branch
If its a branch that spans over multiple days, its advisable to merge develop into the feature branch periodically so that you can make sure work pushed on develop doesnt affect your feature and its also better than doing one big merge into develop on feature completion.
Checkout develop branch
Get the latest from develop
Checkout feature branch
Merge develop branch in
Push the merged code
End the feature branch
Once the feature development is complete, merge it back to develop and delete it. Getting the latest from the feature branch is relevant if multiple developers worked on the feature branch.
Checkout feature branch
Get the latest from feature-10
Checkout develop branch
Get the latest from develop
Merge feature branch in
Push the merged code
Delete local feature branch
Delete remote feature branch
Releases
Releases are done on master branch. When we are ready to release a new version, make sure that all the features going into that release are merged into develop and then merge develop into master.
Merge develop into the master branch
Checkout develop branch
Get the latest from develop
Checkout master branch
Get the latest from master
Merge develop in
Push the merged code
Testing is done against master build and all bugfixes are done on master. When the release is ready to go to production, master is tagged and the bugfixes are merged back to develop. Bugfixes can also be continuously merged back into develop on an as-needed basis, rather than waiting for all of them to be done. If its a more involved bugfix, one might want to create a separate branch for it if he/she does not want rest of the release testing to get affected. Instructions below do not show a different bugfix branch.
Tag the release
Checkout the master branch
Get the latest from master
Tag master with the release version
Push the tag
Hotfixes
Hotfixes are done on a separate hotfix branch, created off of master branch.
Create the hotfix branch
Checkout master branch
Get the latest from master
Create the hotfix branch off of master and switch to the new branch
Push the hotfix branch to central repo
End the hotfix branch
Once the hotfix(es) are done, merge it back to master and develop and delete it. Instead of merging hotfix into develop, master can be merged into develop too after hotfix is merged into master. If latter is being done, replace hotfix branch name with master in the instructions for merging hotfix in develop. Getting the latest from the hotfix branch is relevant if multiple developers worked on the hotfix branch.
Checkout hotfix branch
Get the latest from hotfix-12
Checkout master branch
Get the latest from master
Merge hotfix branch in
Push the merged code
Checkout develop branch
Get the latest from develop
Merge hotfix branch in
Push the merged code
Delete local hotfix branch
Delete remote hotfix branch
Notes
* Clean up old branches – To clean up old branches locally, that have been deleted from the remote repo, run this command “git remote prune origin”
* Merge conflicts – If a merge results in conflicts, you can resolve them manually or run “git mergetool”. This command will help resolve conflicts using a visual diff tool that is configured for git.
Supplement
* Git 版本控制 branch model 分支模組基本介紹
* Git merge 時使用 fast-forward 的差別
* 何時該用 git merge --no-ff?
* 3.2 Git Branching - Basic Branching and Merging
This is a blog to track what I had learned and share knowledge with all who can take advantage of them
標籤
- [ 英文學習 ]
- [ 計算機概論 ]
- [ 深入雲計算 ]
- [ 雜七雜八 ]
- [ Algorithm in Java ]
- [ Data Structures with Java ]
- [ IR Class ]
- [ Java 文章收集 ]
- [ Java 代碼範本 ]
- [ Java 套件 ]
- [ JVM 應用 ]
- [ LFD Note ]
- [ MangoDB ]
- [ Math CC ]
- [ MongoDB ]
- [ MySQL 小學堂 ]
- [ Python 考題 ]
- [ Python 常見問題 ]
- [ Python 範例代碼 ]
- [心得扎記]
- [網路教學]
- [C 常見考題]
- [C 範例代碼]
- [C/C++ 範例代碼]
- [Intro Alg]
- [Java 代碼範本]
- [Java 套件]
- [Linux 小技巧]
- [Linux 小學堂]
- [Linux 命令]
- [ML In Action]
- [ML]
- [MLP]
- [Postgres]
- [Python 學習筆記]
- [Quick Python]
- [Software Engineering]
- [The python tutorial]
- 工具收集
- 設計模式
- 資料結構
- ActiveMQ In Action
- AI
- Algorithm
- Android
- Ansible
- AWS
- Big Data 研究
- C/C++
- C++
- CCDH
- CI/CD
- Coursera
- Database
- DB
- Design Pattern
- Device Driver Programming
- Docker
- Docker 工具
- Docker Practice
- Eclipse
- English Writing
- ExtJS 3.x
- FP
- Fraud Prevention
- FreeBSD
- GCC
- Git
- Git Pro
- GNU
- Golang
- Gradle
- Groovy
- Hadoop
- Hadoop. Hadoop Ecosystem
- Java
- Java Framework
- Java UI
- JavaIDE
- JavaScript
- Jenkins
- JFreeChart
- Kaggle
- Kali/Metasploit
- Keras
- KVM
- Learn Spark
- LeetCode
- Linux
- Lucene
- Math
- ML
- ML Udemy
- Mockito
- MPI
- Nachos
- Network
- NLP
- node js
- OO
- OpenCL
- OpenMP
- OSC
- OSGi
- Pandas
- Perl
- PostgreSQL
- Py DS
- Python
- Python 自製工具
- Python Std Library
- Python tools
- QEMU
- R
- Real Python
- RIA
- RTC
- Ruby
- Ruby Packages
- Scala
- ScalaIA
- SQLAlchemy
- TensorFlow
- Tools
- UML
- Unix
- Verilog
- Vmware
- Windows 技巧
- wxPython
訂閱:
張貼留言 (Atom)
[Git 常見問題] error: The following untracked working tree files would be overwritten by merge
Source From Here 方案1: // x -----删除忽略文件已经对 git 来说不识别的文件 // d -----删除未被添加到 git 的路径中的文件 // f -----强制运行 # git clean -d -fx 方案2: 今天在服务器上 gi...
-
前言 : 為什麼程序管理這麼重要呢?這是因為: * 首先,本章一開始就談到的,我們在操作系統時的各項工作其實都是經過某個 PID 來達成的 (包括你的 bash 環境), 因此,能不能進行某項工作,就與該程序的權限有關了。 * 再來,如果您的 Linux 系統是個...
-
屬性 : 系統相關 - 檔案與目錄 語法 : du [參數] [檔案] 參數 | 功能 -a | 顯示目錄中個別檔案的大小 -b | 以bytes為單位顯示 -c | 顯示個別檔案大小與總和 -D | 顯示符號鏈結的來源檔大小 -h | Hum...
-
來源自 這裡 說明 : split 是 Perl 中非常有用的函式之一,它可以將一個字串分割並將之置於陣列中。若無特別的指定,該函式亦使用 RE 與 $_ 變數 語法 : * split /PATTERN/,EXPR,LIMIT * split /...
沒有留言:
張貼留言