question about a merge result

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I'm a little bit confused about a merge I have done and the result
suprised me. Thinking about it I'm still not convinced what should be
the result.

Here's the use case:

$ mkdir test-git && cd test-git
$ date > A
$ date > B
$ git init
$ git add .
$ git commit -m "Init"

So far I just created a repo with 2 files A and B

$ git branch b1
$ git rm B
$ git commit -m "remove B"

Now I created a branch 'b1' and remove B file in master branch

$ git checkout b1
$ git rm B
$ git commit -m "remove B"
$ git revert HEAD

Now on 'b1' I did the same as master but I thought that removing B was
a bad idea so I revert the previous commit

$ git checkout master
$ git pull . b1
$ ls B
ls: cannot access B: No such file or directory

So merging 'b1' into master removed the B file even if in branch 'b1'
I restored it.

Could anybody explain me why this is the correct behaviour and why not
file 'B' is not restored as it was done in branch 'b1' ?

thanks
-- 
Francis
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]