| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx

有关git的几个问题,求助高手

0
Git 9983 次浏览
最近在学git,有几个问题弄不明白,求指教,万分感谢。
1.git-diff在比较两个分支时到底是比较的哪个部分?为什么总是不能比较两个分支的最新情况?
2.如何在以前的某一个提交位置创建分支?
3.merge之后发现有冲突,查看之后发现需要改文件,怎么回到merge之前的状态?

求高手,或给出相关资料地址,十分感谢。

4个答案

0
0
0
第一个问题:
Comparing branches

$ git diff topic master    <1>
$ git diff topic..master   <2>
$ git diff topic...master  <3>

1. Changes between the tips of the topic and the master branches.
2. Same as above.
3. Changes that occurred on the master branch since when the topic branch was started off it.


第二个问题:
git branch [--set-upstream | --track | --no-track] [-l] [-f] <branchname> [<start-point>]
<start-point>
The new branch head will point to this commit. It may be given as a branch name, a commit-id, or a tag. If this option is omitted, the current HEAD will be used instead.

例如: git branch newbranch ddaa67f0675cb


第三个问题:
好像无能为力了......
git merge --abort

--abort

Abort the current conflict resolution process, and try to reconstruct the pre-merge state.

If there were uncommitted worktree changes present when the merge started, git merge --abort will in some cases be unable to reconstruct these changes. It is therefore recommended to always commit or stash your changes before running git merge.
0