github - git problem: git pul origin master:master is different from git pull origin master.
我想大声告诉你
我想大声告诉你 2017-05-02 09:42:48
0
1
767

That’s it, I want to practice git conflict resolution.

I built a warehouse on github named p. I cloned a copy of the remote warehouse p on the D drive and F drive of my computer.

I first make modifications to the file on the D drive and submit it to the remote warehouse.

Then on drive F, I deliberately changed a file and then pulled , then git should report a conflict and let me resolve it.

But I use git pull p master:master and git pull p master, the results are different:

This is the git pull p master:master command:
dbx@dbz MINGW64 /f/zns/p (master)
$ git pull p master:master
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 4 (delta 2), reused 4 (delta 2), pack-reused 0
Unpacking objects: 100% (4/4), done.
From github.com:ak74u /p
! [rejected] master -> master (non-fast-forward)
8b34266..f8a04e8 master -> p/master

No conflict occurs

This is the git pull p master command
$ git pull p master
From github.com:ak74u/p

  • branch master -> FETCH_HEAD
    Auto-merging html/some_shit1.html

CONFLICT (content): Merge conflict in html/some_shit1.html
Automatic merge failed; fix conflicts and then commit the result.

There is a conflict and the file has changed

Why do git pull p master:master and git pull p master get different git feedback?

我想大声告诉你
我想大声告诉你

reply all(1)
给我你的怀抱

For details, please see: Ruan Yifeng git tutorial

Excerpted from one of the passages

git pull命令的作用是,取回远程主机某个分支的更新,再与本地的指定分支合并。它的完整格式稍稍有点复杂。

$ git pull <远程主机名> <远程分支名>:<本地分支名>
比如,取回origin主机的next分支,与本地的master分支合并,需要写成下面这样。

$ git pull origin next:master
如果远程分支是与当前分支合并,则冒号后面的部分可以省略。

$ git pull origin next
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template