相关疑难解决方法(0)

将分支指针移动到不同的提交而不签出

要移动已签出分支的分支指针,可以使用该git reset --hard命令.但是如何移动未检出分支的分支指针指向不同的提交(保留所有其他东西,如跟踪的远程分支)?

git git-branch

704
推荐指数
10
解决办法
32万
查看次数

git revert:在实际还原之前是否可以识别可能存在冲突的提交?

有没有办法识别特定提交的"附带"提交(编辑相同行并将导致冲突的提交)?

一个非常简单的例子

$ git init
$ echo test > test
$ git add test
$ git commit -m "First commit"
$ echo test1 > test
$ git commit -am "Second commit"
$ git l
* 95a29dd Second commit
* 30a68e6 First commit
$ type test
test1
Run Code Online (Sandbox Code Playgroud)

假设在这一点上无论出于何种原因我想要恢复30a68e6.

$ git revert 30a68e6
error: could not revert 30a68e6... First commit
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and …
Run Code Online (Sandbox Code Playgroud)

git git-revert

5
推荐指数
1
解决办法
115
查看次数

标签 统计

git ×2

git-branch ×1

git-revert ×1