简体   繁体   English

github合并到一个特定的提交

[英]github merge up to a specific commit

Git allows one to merge up to a specific commit. Git允许一个合并到一个特定的提交。 For example, merging the master branch up to a commit on dev which is not necessarily the latest commit. 例如,将master分支合并到dev上的提交,这不一定是最新的提交。 The command for this is as follows: 该命令如下:

git merge <commitId>

The github web application allows one to manage their branches by kicking of a merge. github Web应用程序允许通过踢合并来管理其分支。 One accomplishes this using "Create a pull request" under the "Compare Changes" view. 可以使用“比较更改”视图下的“创建拉取请求”来完成此操作。 I'm confused by the interface because, if I specify a changeset rather than a branch for comparison, github will not give me the option of starting a pull request (though it will perform the comparison). 我对接口感到困惑,因为如果我指定一个变更集而不是一个分支进行比较,那么github不会给我启动启动请求的选项(尽管它将执行比较)。

Does anyone know whether it is possible to accomplish a merge up to a specific changeset or tag from the github webapp? 有谁知道是否可以从github webapp合并到特定的变更集或标签?

Github pull request are made for branches. Github拉请求是针对分支提出的。

If you like to merge upto specific change, go to that commit using 如果您想合并到特定更改,请使用

git checkout <commit-id>

create a git branch from there 从那里创建一个git分支

 git branch <branch-name>

create a pull request from the newly created branch. 从新创建的分支创建拉取请求。

Example: check this link , it says rajuGT wants to merge 1 commit into sstephenson: master from rajuGT: Object_isObject . 例如:检查这个环节 ,它说rajuGT要合并1到提交sstephenson:从rajuGT :Object_isObject。
here master is sstephenson repository's main branch and Object_isObject is a topic branch which is asked for pull request. 这里master是sstephenson存储库的主分支,而Object_isObject是一个主题分支,需要拉取请求。

Note: Any changes made after pull request to the pull request branch, will be considered in the pull request. 注意:在拉取请求之后,对拉取请求分支所做的任何更改都将在拉取请求中考虑。 So always try to use topic branches for patches. 因此,请始终尝试使用主题分支进行修补。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM