Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
git-tools
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
common-tools
git-tools
Commits
219ac621
Commit
219ac621
authored
Jul 31, 2018
by
huasheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update readme
parent
469dbda2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
.README.md.swp
.README.md.swp
+0
-0
README.md
README.md
+18
-0
No files found.
.README.md.swp
0 → 100644
View file @
219ac621
File added
README.md
View file @
219ac621
...
...
@@ -6,6 +6,7 @@
自己项目clone到本地,然后为命令配置下别名,即可方便后续使用
### 详解
#### git_merge_branch.sh <target_branch> <need_push_after_merge>
提供了方便的分支合并以及向远端仓库推送的命令集合,工作中常见的场景为:提测阶段,需要将开发分支合并到testing分支,然后进行QA环境的部署
##### 参数
...
...
@@ -21,3 +22,20 @@
sh git_merge_bransh.sh testing 1
```
#### git_submit_merge_request.sh <merge_comment>
当项目发布的时候,为了避免对主干master的污染,向master合并分支的时候,最好将自己的开发分支的commit进行一些合并,这个工具可以方便的实现这点
原理也很简单:
-
先从主干master分支切出一个新的分支,命名规则为 当前分支名 + '_merge'
-
将当前分支合并到该分支上,但使用的命令稍微特殊 git merge --squash 当前开发分支名
-
将新切出的分支推送到远端,删除掉本地的该分支,然后切换回自己的开发分支
##### 参数
-
merge_comment
对此次合并操作的描述
##### 使用
```
进入要处理项目根目录下,处理好未提交的代码,保证工作区以及暂存区处于干净的状态
sh git_submit_merge_request.sh '**版本代码发布'
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment